[cfe-dev] clang static analyzer fails to find bug it found previously

Dennis Cote DennisC at harding.ca
Wed Apr 3 15:31:53 PDT 2013


From: Anna Zaks 

I've just realized that the checker's package changed after the commit,
so it's now called alpha.cplusplus.NewDelete.



Hi Anna,


I had seen this already, as mentioned in my previous post. I get the
same diagnostics with and without this checker enabled.


I have verified (using the verbose scan-build output) that the
-enable-checker option is being processed and an -analyze-checker option
is being passed to clang++ for this file (near the end of the command
line). I noticed that the format of this option is different than the
"-analyzer-checker=..." format used for the other checkers, but I don't
know if it is a significant difference.


'/mingw/bin/clang++' '-cc1' '-triple' 'i686-pc-mingw32' '-analyze'
'-disable-free' '-disable-llvm-verifier' '-main-file-name' 'astyl

e_main.cpp' '-analyzer-store=region'
'-analyzer-opt-analyze-nested-blocks' '-analyzer-eagerly-assume'
'-analyzer-checker=core' '-ana

lyzer-checker=unix' '-analyzer-checker=deadcode'

y.insecureAPI.getpw' '-analyzer-checker=security.insecureAPI.gets'
'-analyzer-checker=security.insecureAPI.mktemp' '-analyzer-checke

'-analyzer-checker=security.insecureAPI.vfork' '-analyzer-output'
'plist' '-w' '-mrelocation-model'

'static' '-mdisable-fp-elim' '-fmath-errno' '-mconstructor-aliases'
'-target-cpu' 'pentium4' '-resource-dir' 'C:/MinGW/bin\..\lib\cl

ang\3.3' '-fdeprecated-macro' '-fno-dwarf-directory-asm'
'-fdebug-compilation-dir' 'c:/cmd_line_tools/AStyle/build/gcc'

it' '19' '-fmessage-length' '0' '-mstackrealign' '-fno-use-cxa-atexit'
'-fobjc-runtime=gcc' '-fobjc-default-synthesize-properties' '

-fcxx-exceptions' '-fexceptions' '-fdiagnostics-show-option'
'-backend-option' '-vectorize-loops' '-analyzer-display-progress' '-ana

lyzer-checker' 'alpha.cplusplus.NewDelete' '-analyzer-output=html' '-o'

' '-x' 'c++' 'c:/cmd_line_tools/AStyle/src/astyle_main.cpp'


I also noticed that the analyzer is seeing the problematic function. So
_WIN32 must be defined.


ANALYZE (Syntax): c:/cmd_line_tools/AStyle/src/astyle_main.cpp


Was the behavior of this checker changed when it was demoted to alpha


Dennis Cote

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130403/524c6573/attachment.html>

More information about the cfe-dev mailing list