public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* order of -D and -U is significant
@ 2009-08-03 13:52 Unruh, Erwin
  2009-08-04  8:48 ` Paolo Bonzini
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Unruh, Erwin @ 2009-08-03 13:52 UTC (permalink / raw)
  To: GCC mailing list

In current gcc the order of options -D and -U is significant. The Single Unix(r)
Specification explicitly specifies that the order should not matter for the c89 
command. It reads (cited from version 2, which is ten years old):

-D name[=value]
Define name as if by a C-language #define directive. If no =value is given,
a value of 1 will be used. The -D option has lower precedence than the -U
option. That is, if name is used in both a -U and a -D option, name will be
undefined regardless of the order of the options. Additional
implementation-dependent names may be provided by the compiler. Implementations
support at least 2048 bytes of -D definitions and 256 names. 

I did not find a justification for the current gcc behavior. Searching revealed
a patch which implemented the behavior:
	http://gcc.gnu.org/ml/gcc-patches/2000-12/msg00621.html
and two messages earlier that year which might be relevant:
	http://gcc.gnu.org/ml/gcc/2000-09/msg00673.html
	http://gcc.gnu.org/ml/gcc-patches/2000-08/msg01271.html
The original bug report was:
	http://gcc.gnu.org/ml/gcc-bugs/2000-08/msg00605.html
Neither message mentions a possible dependency to the unix specification.
Three years later the code went from the preprocessor to the frontend
	http://gcc.gnu.org/ml/gcc-patches/2003-03/msg01432.html

I now have two questions:
1) Does anybody recall a discussion of this topic?
2) Is this a bug?

	Erwin

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

end of thread, other threads:[~2009-08-05 15:28 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-03 13:52 order of -D and -U is significant Unruh, Erwin
2009-08-04  8:48 ` Paolo Bonzini
2009-08-04 13:59   ` Vincent Lefevre
2009-08-04 13:51 ` Vincent Lefevre
2009-08-04 15:20 ` Tom Tromey
2009-08-04 16:12   ` Joe Buck
2009-08-04 20:13     ` Ross Smith
2009-08-04 22:56       ` Joe Buck
2009-08-05  3:11         ` Vincent Lefevre
2009-08-05  9:17           ` Dave Korn
2009-08-05  9:35             ` Vincent Lefevre
2009-08-05  9:45               ` Dave Korn
2009-08-05 13:21             ` Joseph S. Myers
2009-08-05 15:59           ` Joe Buck

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