[Bug c/51437] GCC should warn on the use of reserved identifier/macro names

bugdal at aerifal dot cx gcc-bugzilla@gcc.gnu.org
Sun Feb 19 04:42:00 GMT 2012


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

Rich Felker <bugdal at aerifal dot cx> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugdal at aerifal dot cx

--- Comment #6 from Rich Felker <bugdal at aerifal dot cx> 2012-02-19 04:27:43 UTC ---
I would greatly like to see this as well; actually I was just about to file a
duplicate report when I found this, as a result of finding "struct _Color" in
GIMP source... >_<

I think the system headers issue could be handled very easily, with no false
positives and few false negatives. The heuristic would basically be to flag any
occurrence of reserved names except in header files found in the -isystem path,
or in text resulting from expansion of a macro defined by a header file in the
-isystem path.



More information about the Gcc-bugs mailing list