[cfe-dev] Clang static analyzer: ignore library headers?

Aemon Cannon aemoncannon at gmail.com
Mon Sep 16 11:09:46 PDT 2013


Yes, I'm mostly interested in hiding issues from those headers (performance
is a side benefit).

I'll look into the approaches you suggested.

Thanks very much,
Aemon


On Mon, Sep 16, 2013 at 2:02 PM, Anna Zaks <ganna at apple.com> wrote:

> Are you mostly concerned abut performance implications of analyzing third
> party headers?
> One might also not want to show issues reported in those, in which case
> the black list might also be useful.
>
> You could add another option to the analyzer that enables checking only in
> the project headers. This would be similar to how !AnalyzeAll option works
> - we just skip the functions defined in headers in AnalysisConsumer. (Note,
> that if you just wanted to suppress the issues, you could most likely do it
> from the checker.)
>
> If you are to add another option, note that we are switching to a new
> method of defining options - you should not need to modify
> CompilerInviocation, for example, see "shouldReportIssuesInMainSourceFile"
> .
>
> Anna.
>
> On Sep 16, 2013, at 10:40 AM, Aemon Cannon <aemoncannon at gmail.com> wrote:
>
> Hi Anna,
>
> I would be happy with some way to specify a local blacklist. At the
> moment,  once I enable the analyzer-header option, it doesn't seem like I
> have any sway over which headers the checker is run over. I suspect my
> checker is doing a lot of extra work grinding through library headers.
>
> (it may help to know that this is an intraprocedural analysis, so I don't
> care about chasing arguments into libraries)
>
> Thanks, Aemon
>
>
> On Mon, Sep 16, 2013 at 1:16 PM, Anna Zaks <ganna at apple.com> wrote:
>
>> We don't have a list of known third-party headers anywhere, but having
>> this seems generally useful.
>>
>> Anna.
>> On Sep 14, 2013, at 10:22 PM, Aemon Cannon <aemoncannon at gmail.com> wrote:
>>
>> > I'd want to enable analysis of project headers
>> (-analyzer-opt-analyze-headers), but would like to ignore third-party
>> library headers. Currently I have an ad hoc, in-checker, solution to this
>> problem, but was wondering if there's an easier way. Would be nice if there
>> was a blacklist of directories or something.
>> >
>> > Thanks,
>> > Aemon
>> > _______________________________________________
>> > cfe-dev mailing list
>> > cfe-dev at cs.uiuc.edu
>> > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>>
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130916/22155074/attachment.html>


More information about the cfe-dev mailing list