[cfe-dev] Disabling clang compiler warnings, but not static analyzer ones

Gábor Kozár kozargabor at gmail.com
Thu Jul 11 09:05:39 PDT 2013


Thanks Anna, you're right, it works when passed directly to clang, but not
when using -Xclang.


2013/7/5 Anna Zaks <ganna at apple.com>

>
> On Jul 5, 2013, at 4:59 AM, Gábor Kozár <kozargabor at gmail.com> wrote:
>
> Hi,
>
> To test the checkers we've developed, we would like to disable all clang
> warnings, except from the ones coming from our checker. We've tried the -w
> flag, but it also suppresses our own checker's warnings.
>
>
> Is there something special in your setup?
> The -w flag should not/does not suppress warnings coming from the analyzer:
>
> Ex:
> $clang -w --analyze ~/tmp/ex.m
> */Users/zaks/tmp/ex.m:4:11: **warning: **Division by zero*
>   return 5/zero + 5/0;
> *         ~^~~~~*
> 1 warning generated.
> *
> *
>
> We're running the clang with the -Xclang -analyzer-checker="testchecker"
> flags.
>
> We have some work-around ideas (putting a unique marker string in our
> warnings, and filter out any warnings that do not contain them), but I feel
> that this is something most checker developers would run into
> sooner-or-later, so surely, there must be a better solution.
>
> So how could we disable all clang warnings, except for the ones emitted by
> our specific checker?
>
> Thanks!
>
> Gabor
> _______________________________________________
> 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/20130711/4504bb69/attachment.html>


More information about the cfe-dev mailing list