[Bug preprocessor/12607] preprocessor fails to diagnose an undefined ## result

sebor at roguewave dot com gcc-bugzilla@gcc.gnu.org
Thu Oct 16 16:18:00 GMT 2003


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12607



------- Additional Comments From sebor at roguewave dot com  2003-10-16 16:18 -------
While talking to HP about their bugs in operator ## it came up that the program
below relies on undefined behavior since the order of evaluation of the operator
is unspecified. I think it might be useful to issue a portability warning in
this case when -Wall is on the command line.

$ cat t.cpp && gcc -Wall -E t.cpp
#define CAT3(a, b, c)   a ## b ## c

CAT3 (-, >, *)
# 1 "t.cpp"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "t.cpp"


->*



More information about the Gcc-bugs mailing list