[cfe-dev] clang --analyze: how do I get more verbose diagnostics?

Jordan Rose jordan_rose at apple.com
Tue Nov 19 09:16:46 PST 2013


On Nov 19, 2013, at 8:59 , Richard <legalize at xmission.com> wrote:

> 
> In article <20131119113333.GA5152 at britannica.bec.de>,
>    Joerg Sonnenberger <joerg at britannica.bec.de> writes:
> 
>> On Mon, Nov 18, 2013 at 09:54:17PM -0700, Richard wrote:
>>> We use SCons for our build system.  When I run 'scan-build scons
>>> <args>', my build runs for a long time and reports various warnings
>>> from the analysis as it runs.
>> 
>> I would recomment starting by replacing scons, but at the very least
>> sure that your construct honors CC etc from environment.
> 
> Sorry, but suggesting someone replace their build system is not 
> going to be taken seriously.  This also runs contrary to the entire
> point of scan-build.
> 
> If my build environment wasn't getting clang for compilation, then I
> wouldn't be getting clang analysis diangostics in the output of the
> build as I already stated was happening.
> 
> Clearly it is running as I get these .plist directories with HTML
> reports in them.  What I don't get is a summary report that combines
> the .plist directory contents.   Also, from reading the description of
> scan-build, it implies that all the reports are put in a directory in
> /tmp, which clearly isn't happening.

That definitely isn’t how it’s supposed to work, but…does scons clear the environment before it invokes the compiler? scan-build works by setting environment variables that are then picked up by its helper script, ccc-analyzer.

It looks like this is a known issue: http://stackoverflow.com/questions/9305356/how-can-i-make-clangs-scan-build-work-with-scons. We should add that to the site.

Jordan

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20131119/26307c11/attachment.html>


More information about the cfe-dev mailing list