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

josh at joshtriplett dot org gcc-bugzilla@gcc.gnu.org
Sun Feb 19 18:57:00 GMT 2012


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

--- Comment #12 from Josh Triplett <josh at joshtriplett dot org> 2012-02-19 18:50:34 UTC ---
(In reply to comment #10)
> (In reply to comment #9)
> > However, note that the standards also reserve various other classes of names,
> > such as types ending in _t, for which GCC should only flag definitions, not
> > uses.  Only system headers should define new _t types, but user code can *use*
> > types like time_t or pid_t without warning.
> 
> These are only reserved for POSIX, and should not always be warned about!

I stand corrected.  I thought that the C standard reserved types with a _t
suffix, but I just re-checked the C99 and C11 specs and they don't have that
reservation, only some more specific reservations such as the others I
mentioned.



More information about the Gcc-bugs mailing list