analyzer: invoking a single analyzer from the static analysis tools.


I think something got lost in my message. I understand the process that you’re talking about, but when I did it I needed to manually modify the resulting bash script that was emitted; that’s why I was asking about you posting the full clang command (so I could see if you had made similar changes to what I had). I did this through clang originally with -###, so perhaps some of the edits aren’t necessary since you used scan-build, but one thing I’m wondering about is if the command that you’re ultimately running invokes the system installed clang or your locally built one, as I needed to use -use-analyzer=… when invoking scan-build.

Ok, no worries. I’ve pasted the content of the “custom” shell script.

The option marked (*) is what I added to enable my checker, but it seems to have no effect. I’m racking my brains to work it out. No successful result for the time being, though.

Here you are. I hope it helps.

/usr/local/src/build/Release+Asserts/bin/clang ‘-cc1’
‘-triple’ ‘x86_64-unknown-linux-gnu’
‘-main-file-name’ ‘dcl41c_03_bad.c’
‘-analyzer-output’ ‘plist’ ‘-w’
‘-mrelocation-model’ ‘static’
‘-mdisable-fp-elim’ ‘-fmath-errno’
‘-mconstructor-aliases’ ‘-munwind-tables’
‘-target-cpu’ ‘x86-64’
‘-target-linker-version’ ‘2.22’
‘-resource-dir’ ‘/usr/local/src/build/Release+Asserts/bin/…/lib/clang/3.5’
‘-internal-isystem’ ‘/usr/local/include’
‘-internal-isystem’ ‘/usr/local/src/build/Release+Asserts/bin/…/lib/clang/3.5/include’
‘-internal-externc-isystem’ ‘/usr/include/x86_64-linux-gnu’
‘-internal-externc-isystem’ ‘/include’
‘-internal-externc-isystem’ ‘/usr/include’
‘-fdebug-compilation-dir’ ‘/home/user1/src’
‘-ferror-limit’ ‘19’ ‘-fmessage-length’ ‘0’
‘-fobjc-runtime=gcc’ ‘-fdiagnostics-show-option’
(*) ‘’
‘-o’ ‘/tmp/scan-build-2014-02-26-4’
‘-x’ ‘c’ ‘dcl41c_03_bad.c’

This doesn’t have the same issue that I encountered. As far as I can tell it should do what you expect, but that’s not saying much.