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: 14 Oct 2003 01:00:33 -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-14 01:00 -------
I see. I think I agree with you: it's the pp-token immediatley preceding the ##
operator that, after concatenation, must form another valid token, and it is not
required that the pp-token (or sequence thereof) substituted for the macro
parameter form a single valid token after concatentation. Looks like HP
misinterpreted this the same way I did -- their preprocessor complains (see below).
I would still appreciate if the request to turn this into a warning and only
with -Wall were considered :)
Thanks
Martin
Warning (anachronism) 823: "t.cpp", line 6 # Redundant preprocessing
concatenation operation results in two valid preprocessing tokens. Depending on
this implementation defined behavior will result in non-portable code.
/* 6 */ int j = CAT (s.a, b); // #2
^
int j = s.ab ;