public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug preprocessor/64220] New: gcc preprocessor defines outside of the reserved namespace: unix linux AVR
@ 2014-12-08 11:24 cameron at tacklind dot com
  2014-12-08 12:52 ` [Bug preprocessor/64220] " jakub at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: cameron at tacklind dot com @ 2014-12-08 11:24 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64220

            Bug ID: 64220
           Summary: gcc preprocessor defines outside of the reserved
                    namespace: unix linux AVR
           Product: gcc
           Version: 4.9.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: preprocessor
          Assignee: unassigned at gcc dot gnu.org
          Reporter: cameron at tacklind dot com

The preprocessor defines names outside of the reserved namespace.

Essentially, if I'm not mistaken, the following command should output nothing
# gcc -dM -E - < /dev/null | grep -v '^#define _[_A-Z]'

However, for historical reasons, the preprocessor defines things like "unix"
and "linux" or "AVR" (with avr-gcc). I'm sure other show up on other systems
that I have not tested.

This has been referenced slightly in #2069, but the solution there was to just
manually un-define (-U) the extra define. (Which I'll do if I have to)

This is also talked about briefly in the documentation where it suggest better
alternatives like __unix__ et al. It even says "The C standard requires that
all system-specific macros be part of the reserved namespace."

https://gcc.gnu.org/onlinedocs/cpp/System-specific-Predefined-Macros.html

Could these defines outside of the reserved namespace be removed? Or deprecated
now (if they aren't already?) and removed in 5.0?

Or are those defines here to stay for historical reasons?


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-07-21  9:40 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-08 11:24 [Bug preprocessor/64220] New: gcc preprocessor defines outside of the reserved namespace: unix linux AVR cameron at tacklind dot com
2014-12-08 12:52 ` [Bug preprocessor/64220] " jakub at gcc dot gnu.org
2014-12-08 13:22 ` rguenth at gcc dot gnu.org
2014-12-09  1:28 ` cameron at tacklind dot com
2014-12-09  1:29 ` pinskia at gcc dot gnu.org
2014-12-09  1:30 ` pinskia at gcc dot gnu.org
2014-12-09  1:41 ` cameron at tacklind dot com
2015-07-21  9:40 ` gjl at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).