Makes perfect sense, and patch LGTM. Thanks!

On Fri, Apr 4, 2014 at 3:16 AM, Lubos Lunak <[email protected]> wrote:

>
>  Option -frewrite-includes comments out #include directives it replaces by
> enclosing it in #if 0, which moves the included contents, changing their
> perceived line numbers e.g. in the "In file included from" messages in a
> follow-up compilation:
>
> $ cat b.cpp
> #include "b.h"
> $ cat b.h
> void f()
>     {
>     int unused_variable;
>     }
> $ clang++ -E -frewrite-includes b.cpp | clang++ -Wall -x c++ -c -
> In file included from b.cpp:4:
> ./b.h:3:9: warning: unused variable 'unused_variable' [-Wunused-variable]
>     int unused_variable;
>         ^
> 1 warning generated.
> $ clang++ -Wall -c b.cpp
> In file included from b.cpp:1:
> ./b.h:3:9: warning: unused variable 'unused_variable' [-Wunused-variable]
>     int unused_variable;
>         ^
> 1 warning generated.
>
>  The attached patch fixes this.
>
> --
>  Lubos Lunak
>
> _______________________________________________
> cfe-commits mailing list
> [email protected]
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
>
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to