[Bug c++/55252] Caret diagnostic doesn't show useful location when macro clashes with name in system header

manu at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sat Nov 10 23:10:00 GMT 2012


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

--- Comment #4 from Manuel López-Ibáñez <manu at gcc dot gnu.org> 2012-11-10 23:10:32 UTC ---
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...). On the other hand, this is a very contrived testcase. I
wouldn't expect in normal code that the expansion point to be in a
system-header and the spelling point in a non-system-header.

Dodji, what do you think?



More information about the Gcc-bugs mailing list