[cfe-dev] ccache + clang warnings that are suppressed during macro expansion

Nico Weber thakis at chromium.org
Tue Sep 20 16:47:12 PDT 2011


Could -E mode insert #pragmas to disable these warnings for source
that originates from macro expansions? That way, when clang recompiles
its preprocessed output, it shows the same warnings it showed the
first time round, which seems nice independent of ccache.

(I'm not sure many people ran into this so far – when we started using
ccache in chromium a few weeks ago, we had to add code to both clang
and ccache to make it work at all. We have since switched away from
ccache, but back when we used it we found all the "unused commandline
flags" that arise from this combination more annoying.)

Nico

On Tue, Sep 20, 2011 at 4:40 PM, Ted Kremenek <kremenek at apple.com> wrote:
>
> On Sep 20, 2011, at 4:03 PM, David Blaikie wrote:
>>
>> (1) Clang suppresses some warnings in macro expansions, e.g.
>> -Wparentheses-equality.
>
> That seems rather not good. Do we do this deliberately (if so, why?), or is
> it just an accident/bug?
> - David
>
> This is no accident.  I don't have an exhaustive list, but we do this in
> several cases.  The argument is that some warnings are almost always false
> positives when they result from macro expansions, but are very useful
> otherwise.  This of course leads to the problem that preprocessed files can
> have more warnings than the original source, but it does allow us to be more
> aggressive about putting various warnings under -Wall.
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
>




More information about the cfe-dev mailing list