From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25005 invoked by alias); 8 Dec 2014 11:24:19 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 24334 invoked by uid 48); 8 Dec 2014 11:24:11 -0000 From: "cameron at tacklind dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug preprocessor/64220] New: gcc preprocessor defines outside of the reserved namespace: unix linux AVR Date: Mon, 08 Dec 2014 11:24:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: preprocessor X-Bugzilla-Version: 4.9.3 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cameron at tacklind dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-12/txt/msg00713.txt.bz2 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?