Thanks for the response Chris. I tried that option too, still no luck. This is the console output.
~/.../example/freertos-example-llvm >>> COMPILER=clang scan-build --use-cc=/usr/bin/clang make
scan-build: Using '/usr/bin/clang-10' for static analysis
/usr/bin/../lib/clang/ccc-analyzer
===Clang Compiler Detected===
===GCC Compiler Detected===
Compiling src/builtin_scanbuild_examples.c
/home/rajah/workspace/interrupt/example/freertos-example-llvm/src/builtin_scanbuild_examples.c:11:13: warning: Dereference of null pointer (loaded from variable 'pointer')
result += *pointer;
^~~~~~~~
/home/rajah/workspace/interrupt/example/freertos-example-llvm/src/builtin_scanbuild_examples.c:18:12: warning: Division by zero
rv = 1 / denominator;
~~^~~~~~~~~~~~~
2 warnings generated.
Compiling src/main.c
Compiling src/memory_leak_examples.c
/home/rajah/workspace/interrupt/example/freertos-example-llvm/src/memory_leak_examples.c:11:3: warning: Attempt to free released memory
free(ptr);
^~~~~~~~~
/home/rajah/workspace/interrupt/example/freertos-example-llvm/src/memory_leak_examples.c:16:12: warning: Use of memory after it is freed
sum += ptr[i];
^~~~~~
/home/rajah/workspace/interrupt/example/freertos-example-llvm/src/memory_leak_examples.c:31:9: warning: Assigned value is garbage or undefined
sum += ptr[i];
^ ~~~~~~
/home/rajah/workspace/interrupt/example/freertos-example-llvm/src/memory_leak_examples.c:47:12: warning: Potential leak of memory pointed to by 'ptr'
return 1;
^
/home/rajah/workspace/interrupt/example/freertos-example-llvm/src/memory_leak_examples.c:65:5: warning: Attempt to free released memory
memory_pool_free(ptr);
^~~~~~~~~~~~~~~~~~~~~
/home/rajah/workspace/interrupt/example/freertos-example-llvm/include/example_project/memory_pool.h:13:26: note: expanded from macro 'memory_pool_free'
#define memory_pool_free free
^
/home/rajah/workspace/interrupt/example/freertos-example-llvm/src/memory_leak_examples.c:68:3: warning: Use of memory after it is freed
memset(ptr, 0x5e, size);
^~~~~~~~~~~~~~~~~~~~~~~
6 warnings generated.
Compiling src/memory_pool.c
Compiling src/mutex_examples.c
Compiling src/stub_functions.c
Compiling src/freertos_lock_port.c
Compiling src/startup.c
Compiling freertos_kernel/tasks.c
Compiling freertos_kernel/queue.c
Compiling freertos_kernel/list.c
Compiling freertos_kernel/timers.c
Compiling freertos_kernel/portable/GCC/ARM_CM4F/port.c
Compiling freertos_kernel/portable/MemMang/heap_1.c
Linking library
ld.lld: error: unable to find library -lgcc
clang-10: error: ld.lld command failed with exit code 1 (use -v to see invocation)
make: *** [Makefile:148: /home/rajah/workspace/interrupt/example/freertos-example-llvm/build/nrf52.elf] Error 1
scan-build: 8 bugs found.
scan-build: Run 'scan-view /tmp/scan-build-2020-06-05-165601-6412-1' to examine bug reports.
This is the console output when I just run make. Looks like arm-none-eabi-ld/gcc is able to find gcc library.
~/.../example/freertos-example-llvm >>> make
arm-none-eabi-gcc
===GCC Compiler Detected===
Linking library
/usr/lib/gcc/arm-none-eabi/10.1.0/../../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/10.1.0/thumb/v7e-m+fp/hard/libgcc.a(_udivmoddi4.o) uses variable-size enums yet the output is to use 32-bit enums; use of enum values across objects may fail
/usr/lib/gcc/arm-none-eabi/10.1.0/../../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/10.1.0/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc.a(lib_a-aeabi_memclr.o) uses variable-size enums yet the output is to use 32-bit enums; use of enum values across objects may fail
/usr/lib/gcc/arm-none-eabi/10.1.0/../../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/10.1.0/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc.a(lib_a-aeabi_memcpy.o) uses variable-size enums yet the output is to use 32-bit enums; use of enum values across objects may fail
/usr/lib/gcc/arm-none-eabi/10.1.0/../../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/10.1.0/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc.a(lib_a-malloc.o) uses variable-size enums yet the output is to use 32-bit enums; use of enum values across objects may fail
/usr/lib/gcc/arm-none-eabi/10.1.0/../../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/10.1.0/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc.a(lib_a-mallocr.o) uses variable-size enums yet the output is to use 32-bit enums; use of enum values across objects may fail
/usr/lib/gcc/arm-none-eabi/10.1.0/../../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/10.1.0/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc.a(lib_a-mlock.o) uses variable-size enums yet the output is to use 32-bit enums; use of enum values across objects may fail
/usr/lib/gcc/arm-none-eabi/10.1.0/../../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/10.1.0/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc.a(lib_a-sbrkr.o) uses variable-size enums yet the output is to use 32-bit enums; use of enum values across objects may fail
/usr/lib/gcc/arm-none-eabi/10.1.0/../../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/10.1.0/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc.a(lib_a-freer.o) uses variable-size enums yet the output is to use 32-bit enums; use of enum values across objects may fail
/usr/lib/gcc/arm-none-eabi/10.1.0/../../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/10.1.0/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc.a(lib_a-impure.o) uses variable-size enums yet the output is to use 32-bit enums; use of enum values across objects may fail
/usr/lib/gcc/arm-none-eabi/10.1.0/../../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/10.1.0/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc.a(lib_a-lock.o) uses variable-size enums yet the output is to use 32-bit enums; use of enum values across objects may fail
/usr/lib/gcc/arm-none-eabi/10.1.0/../../../../arm-none-eabi/bin/ld: warning: /usr/lib/gcc/arm-none-eabi/10.1.0/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard/libc.a(lib_a-reent.o) uses variable-size enums yet the output is to use 32-bit enums; use of enum values across objects may fail
Generated build/nrf52.elf
Does clang require a separate step to install compatible libraries? I wonder if this related to Arch/linux. Do you have a linux machine or Arch VM on your end?
Thanks,
Rajah