This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug preprocessor/12607] preprocessor fails to diagnose an undefined ## result
- From: "sebor at roguewave dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 16 Oct 2003 16:18:37 -0000
- Subject: [Bug preprocessor/12607] preprocessor fails to diagnose an undefined ## result
- References: <20031013234821.12607.sebor@roguewave.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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"
->*