[PATCH] PR15614 : -frewrite-includes causes -Wunused-macros false positives #2

Lubos Lunak l.lunak at centrum.cz
Thu May 1 08:07:01 PDT 2014


On Sunday 13 of April 2014, Richard Smith wrote:
> On Fri, Apr 4, 2014 at 3:47 AM, Lubos Lunak <l.lunak at centrum.cz> wrote:
> >  This is a re-send of
> >
> > http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20131125/09423
> >1.html which went without any answer.
> >
> >  See PR15614 for a testcase.
>
> The combination of -Wunused-macro and -frewrite-includes still doesn't
> really work with this patch applied: if the only use of a macro is within a
> preprocessor directive that -frewrite-includes expands, we'll still warn
> about it. Unfortunately I don't have any great ideas as to how to solve
> this; the least bad idea I have is to add a '#pragma clang macro_used
> BLAH', and emit that for each macro that's used in the -frewrite-includes
> run.

 But that's not directly related to this patch, is it? The patch fixes a 
relatively common case, and even if your rare case remains, the patch is 
still an improvement.

-- 
 Lubos Lunak



More information about the cfe-commits mailing list