This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/78425] New: Atrtibute warning message location incorrect
- From: "suckfish at ihug dot co.nz" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 19 Nov 2016 03:25:37 +0000
- Subject: [Bug c++/78425] New: Atrtibute warning message location incorrect
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78425
Bug ID: 78425
Summary: Atrtibute warning message location incorrect
Product: gcc
Version: 6.2.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: suckfish at ihug dot co.nz
Target Milestone: ---
The following C++ code produces a warning message, but the location given for
the warning message is not right. (gcc claims it comes from the expansion of
the macro GOOD. In fact it comes from the expansion of BAD).
-----------
#define BAD [[notreturn]]
#define GOOD __attribute__((format(printf,1,2)))
void foo BAD (const char * fmt, ...) GOOD;
-----------
$ gcc -c temp.cc
temp.cc:2:48: warning: ‘notreturn’ attribute directive ignored [-Wattributes]
#define GOOD __attribute__((format(printf,1,2)))
^
temp.cc:4:38: note: in expansion of macro ‘GOOD’
void foo BAD (const char * fmt, ...) GOOD;
^~~~
$ gcc --version
gcc (GCC) 6.2.1 20160916 (Red Hat 6.2.1-2)