Re: behavior of -D=FOO

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Marty,

Looks like 2.95.x treats it as an error (attempting to define a 0-length
identifier), but 3.x and 4.x accept it.

Notice this effect:
touch test.cpp
g++ -E -dM -D=FOO\ 3 test.cpp | grep FOO

In 3.x and 4.x:
#define FOO 3

Hmm!

Reading the documentation carefully, it appears that:
-DFOO
-DFOO=3
is preferred, and
-D FOO
-D FOO=3
is acceptable.  At least with 3.x and 4.x.

I'm willing to bet that this:
-D=FOO\ 3
is probably frowned upon, and I'd consider it a "negative testing"
(artifact) bug against the command line parser.

Sincerely,
--Eljay
"I hate the preprocessor."


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux