This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]