Open Quuxplusone opened 6 years ago
Bugzilla Link | PR37268 |
Status | NEW |
Importance | P normal |
Reported by | Benny K J (benny.kj@gadgeon.com) |
Reported on | 2018-04-27 06:09:37 -0700 |
Last modified on | 2018-04-27 20:22:31 -0700 |
Version | 6.0 |
Hardware | PC other |
CC | benny.kj@gadgeon.com, llvm-bugs@lists.llvm.org |
Fixed by commit(s) | |
Attachments | |
Blocks | |
Blocked by | |
See also |
I have tried to run the clang as below on individual source files of the
project without specifying any compiler and it is able to generate the below
output.
So it seems that my invocation of the scan-build command may be wrong.
Kindly suggest how to debug further so that I can run the analyzer on the
entire project.
============================
Output Log
============================
PS C:\Users\benny> C:\LLVM\bin\clang --analyze -Xanalyzer "-analyzer-
checker=alpha.core.PointerArithm" "C:\Users\benny\D
ocuments\IAR Embedded Workbench\avr\examples\IAR\STK500\ledchaser.c"
C:\Users\benny\Documents\IAR Embedded
Workbench\avr\examples\IAR\STK500\ledchaser.c:36:3: warning: Value stored to 'p'
is never read
p = &x + 1; // warn
^ ~~~~~~
C:\Users\benny\Documents\IAR Embedded
Workbench\avr\examples\IAR\STK500\ledchaser.c:36:10: warning: Pointer arithmetic
on non-array variables relies on memory layout, which is dangerous
p = &x + 1; // warn
~~ ^
C:\Users\benny\Documents\IAR Embedded
Workbench\avr\examples\IAR\STK500\ledchaser.c:42:3: warning: Called function
pointer is null (null dereference)
foo(); // warn: function pointer is null
^~~~~
3 warnings generated.