http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55252

--- Comment #7 from dodji at seketeli dot org <dodji at seketeli dot org> 
2012-11-19 16:34:11 UTC ---
"manu at gcc dot gnu.org" <gcc-bugzi...@gcc.gnu.org> a écrit:

> On the other hand, let's consider:
> pr55252.c:
>
> #define bar 256
> #include "pr55252.h"
>
> pr55252.h:
>
> #pragma GCC system_header
> signed char foo = bar;
>
>
>
> In this case, I would expect the warning to be suppressed (as it is with
>
> -ftrack-macro-expansion=0). However, since the warning is actually
> given in the C file, it is emitted. I am getting more and more
> convinced that expanding to spelling point might not be the best (I
> think Paolo Bonzini raised this issue at the time...).

I am thinking that a way to really handle this correctly is to have the
concept of the location of the "current expression", which the current
token belongs to.

In this case, we are emitting the warning on the token 'bar' (which is
spelled in the C file), while the relevant expression (the variable
declaration) is in a header file.

The diagnostics machinery should be able to say "is the current
expression in a header file?", and act appropriately.

Would that make sense in the grand scheme of things?

Reply via email to