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++/78425] New: Atrtibute warning message location incorrect


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)

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