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

Aitor,

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.

#!/bin/bash
/usr/local/src/build/Release+Asserts/bin/clang ‘-cc1’
‘-triple’ ‘x86_64-unknown-linux-gnu’
‘-analyze’
‘-disable-free’
‘-main-file-name’ ‘dcl41c_03_bad.c’
‘-analyzer-store=region’
‘-analyzer-opt-analyze-nested-blocks’
‘-analyzer-eagerly-assume’
‘-analyzer-checker=core’
‘-analyzer-checker=unix’
‘-analyzer-checker=deadcode’
‘-analyzer-checker=security.insecureAPI.UncheckedReturn’
‘-analyzer-checker=security.insecureAPI.getpw’
‘-analyzer-checker=security.insecureAPI.gets’
‘-analyzer-checker=security.insecureAPI.mktemp’
‘-analyzer-checker=security.insecureAPI.mkstemp’
‘-analyzer-checker=security.insecureAPI.vfork’
‘-analyzer-output’ ‘plist’ ‘-w’
‘-mrelocation-model’ ‘static’
‘-mdisable-fp-elim’ ‘-fmath-errno’
‘-masm-verbose’
‘-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’
‘-mstackrealign’
‘-fobjc-runtime=gcc’ ‘-fdiagnostics-show-option’
‘-vectorize-slp’
‘-analyzer-display-progress’
(*) ‘-analyzer-checker=alpha.security.DCL41C’
‘-analyzer-output=html’
‘-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.