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

* [Bug preprocessor/64220] gcc preprocessor defines outside of the reserved namespace: unix linux AVR
  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 ` jakub at gcc dot gnu.org
  2014-12-08 13:22 ` rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-12-08 12:52 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
What is wrong on this?  You are not requesting any strict conformance mode, and
with GNU extensions those are acceptable.  Retry with -std=c89, -std=c99,
-std=c11, -ansi or similar options, then those macros shouldn't be defined.


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

* [Bug preprocessor/64220] gcc preprocessor defines outside of the reserved namespace: unix linux AVR
  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
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-12-08 13:22 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING
   Last reconfirmed|                            |2014-12-08
     Ever confirmed|0                           |1


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

* [Bug preprocessor/64220] gcc preprocessor defines outside of the reserved namespace: unix linux AVR
  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
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: cameron at tacklind dot com @ 2014-12-09  1:28 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Cameron Tacklind <cameron at tacklind dot com> ---
Ah, I had not seen a reference to the -std making a difference. You are right
that adding -std=c99 removes the extra define.

Of note, I'm finding it difficult to find where this behavior (the define being
in gnuXX and not cXX) is described in the documentation. (But I may just be
blind)

If this is a desired define behavior, then by all means leave it and please
close this as a "WONTFIX". I just wanted to bring this up, in particular,
because I want to use AVR in a project I'm working on and I had not seen a good
reason for its existence besides deprecated usage.


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

* [Bug preprocessor/64220] gcc preprocessor defines outside of the reserved namespace: unix linux AVR
  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
                   ` (2 preceding siblings ...)
  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
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2014-12-09  1:29 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
https://gcc.gnu.org/onlinedocs/gcc-4.9.2/cpp/System-specific-Predefined-Macros.html#System-specific-Predefined-Macros


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

* [Bug preprocessor/64220] gcc preprocessor defines outside of the reserved namespace: unix linux AVR
  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
                   ` (3 preceding siblings ...)
  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
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2014-12-09  1:30 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #3)
> https://gcc.gnu.org/onlinedocs/gcc-4.9.2/cpp/System-specific-Predefined-
> Macros.html#System-specific-Predefined-Macros

When the -ansi option, or any -std option that requests strict conformance, is
given to the compiler, all the system-specific predefined macros outside the
reserved namespace are suppressed. The parallel macros, inside the reserved
namespace, remain defined.


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

* [Bug preprocessor/64220] gcc preprocessor defines outside of the reserved namespace: unix linux AVR
  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
                   ` (4 preceding siblings ...)
  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
  6 siblings, 0 replies; 8+ messages in thread
From: cameron at tacklind dot com @ 2014-12-09  1:41 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Cameron Tacklind <cameron at tacklind dot com> ---
Pardon my brevity. Yes, I'd seen that.

I was trying to comment on this list seemingly missing a reference to that
particular difference. Or that if it is listed, it is difficult to find.

https://gcc.gnu.org/onlinedocs/gcc/C-Extensions.html

By my main issue persists of extra defines being set outside of the reserved
namespace. If this is something that you do not want to change, I am fine with
that. If so, please close this indicating that you want this behavior.


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

* [Bug preprocessor/64220] gcc preprocessor defines outside of the reserved namespace: unix linux AVR
  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
                   ` (5 preceding siblings ...)
  2014-12-09  1:41 ` cameron at tacklind dot com
@ 2015-07-21  9:40 ` gjl at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: gjl at gcc dot gnu.org @ 2015-07-21  9:40 UTC (permalink / raw)
  To: gcc-bugs

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

Georg-Johann Lay <gjl at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
                 CC|                            |gjl at gcc dot gnu.org
         Resolution|---                         |INVALID

--- Comment #6 from Georg-Johann Lay <gjl at gcc dot gnu.org> ---
Confusion has been resolved with help of the documentation.


^ 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).