-Werror=c++-compat odd behavior

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

 



This version of gcc:

 

$ gcc --version

gcc (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0

 

Plus this three-liner:

 

#define badname im-not-happy

#define initializer(a) #a

 

char *only_a_string = initializer(badname);

 

Produces:

 

$ gcc -c -Werror=c++-compat /tmp/foo.c

/tmp/foo.c:1:20: error: identifier "not" is a special operator name in C++
[-Werror=c++-compat]

#define badname im-not-happy

                    ^

cc1: some warnings being treated as errors

 

This seems pretty odd... Can someone explain what's going on?

 

Thanks... Dave Barach




[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