This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug preprocessor/64220] New: gcc preprocessor defines outside of the reserved namespace: unix linux AVR
- From: "cameron at tacklind dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 08 Dec 2014 11:24:09 +0000
- Subject: [Bug preprocessor/64220] New: gcc preprocessor defines outside of the reserved namespace: unix linux AVR
- Auto-submitted: auto-generated
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?