[Bug preprocessor/28709] [4.0/4.1 regression] Bad diagnostic pasting tokens with ##
--- Comment #14 from jakub at gcc dot gnu dot org 2007-06-26 11:44 --- Subject: Bug 28709 Author: jakub Date: Tue Jun 26 11:43:50 2007 New Revision: 126021 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=126021 Log: PR preprocessor/28709 * macro.c (paste_tokens): Do error reporting here, use BUF with the spelled LHS token as opposed to spelling it again. (paste_all_tokens): Don't report errors here, just break on failure. * gcc.dg/cpp/paste14.c: New test. Added: branches/redhat/gcc-4_1-branch/gcc/testsuite/gcc.dg/cpp/paste14.c Modified: branches/redhat/gcc-4_1-branch/gcc/testsuite/ChangeLog branches/redhat/gcc-4_1-branch/libcpp/ChangeLog branches/redhat/gcc-4_1-branch/libcpp/macro.c -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28709
[Bug preprocessor/28709] [4.0/4.1 regression] Bad diagnostic pasting tokens with ##
--- Comment #12 from tromey at gcc dot gnu dot org 2007-05-02 20:33 --- Subject: Bug 28709 Author: tromey Date: Wed May 2 19:33:44 2007 New Revision: 124356 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=124356 Log: libcpp PR preprocessor/28709: * macro.c (paste_tokens): Remove PASTE_LEFT from the old lhs. gcc/testsuite PR preprocessor/28709: * gcc.dg/cpp/pr28709.c: New file. Added: trunk/gcc/testsuite/gcc.dg/cpp/pr28709.c Modified: trunk/gcc/testsuite/ChangeLog trunk/libcpp/ChangeLog trunk/libcpp/macro.c -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28709
[Bug preprocessor/28709] [4.0/4.1 regression] Bad diagnostic pasting tokens with ##
--- Comment #13 from tromey at gcc dot gnu dot org 2007-05-02 20:34 --- I checked in the follow-up patch to the trunk. So this fully works on 4.3. -- tromey at gcc dot gnu dot org changed: What|Removed |Added Known to work|4.2.0 |4.2.0 4.3.0 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28709
[Bug preprocessor/28709] [4.0/4.1 regression] Bad diagnostic pasting tokens with ##
--- Comment #11 from tromey at gcc dot gnu dot org 2007-04-25 01:29 --- *** Bug 31182 has been marked as a duplicate of this bug. *** -- tromey at gcc dot gnu dot org changed: What|Removed |Added CC||dsb at boyski dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28709
[Bug preprocessor/28709] [4.0/4.1 regression] Bad diagnostic pasting tokens with ##
--- Comment #9 from ahs3 at fc dot hp dot com 2007-03-07 18:43 --- Ah, my fault; I wasn't being clear. I still get the error message with -E, that is true. However, the resulting code from cpp I thought was correct -- it just produces what I thought was a normal C label, and if I ignore the error message, I can compile the output from -E just fine. It seems to me that if cpp no longer recognizes ##, then the message should say so ('deprecated cpp token', or something); if cpp does recognize ##, then I don't think the error message should be produced at all since the resulting tokens ('alldone:') are valid C source. If none of those are the case, what bit of info am I not understanding? And I'm still not sure this is the same bug as the original report -- it seems similar, but let me know if it's something different entirely. Thanks. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28709
[Bug preprocessor/28709] [4.0/4.1 regression] Bad diagnostic pasting tokens with ##
--- Comment #10 from pinskia at gcc dot gnu dot org 2007-03-07 21:39 --- (In reply to comment #9) If none of those are the case, what bit of info am I not understanding? Yes alldone: are really two seperate tokens in C :). If you change the definition of LABEL to: #define LABEL(a, b) a##b : it works exactly the same as you want it to work. And yes it is unrelated to this bug really. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28709
[Bug preprocessor/28709] [4.0/4.1 regression] Bad diagnostic pasting tokens with ##
--- Comment #7 from ahs3 at fc dot hp dot com 2007-03-07 00:49 --- Is this code snippet related to this bug, or a new one entirely? #define LABEL(a, b) a##b##: int main () { LABEL(all,done) return 0; } If I compile it: $ gcc -o foo.o foo.c foo.c:4:1: error: pasting alldone and : does not give a valid preprocessing token However, if I use -E first, and compile the result, the snippet compiles properly, -- ahs3 at fc dot hp dot com changed: What|Removed |Added CC||ahs3 at fc dot hp dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28709
[Bug preprocessor/28709] [4.0/4.1 regression] Bad diagnostic pasting tokens with ##
--- Comment #8 from pinskia at gcc dot gnu dot org 2007-03-07 00:58 --- (In reply to comment #7) Is this code snippet related to this bug, or a new one entirely? Actually the error message is fully correct in that case. $ gcc -o foo.o foo.c foo.c:4:1: error: pasting alldone and : does not give a valid preprocessing token However, if I use -E first, and compile the result, the snippet compiles properly, I don't, I get an error even with -E on the mainline, 3.3.5, and 4.0.2: gcc t.c -E -o t.i t.c:4:1: error: pasting alldone and : does not give a valid preprocessing token -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28709
[Bug preprocessor/28709] [4.0/4.1 regression] Bad diagnostic pasting tokens with ##
-- mmitchel at gcc dot gnu dot org changed: What|Removed |Added Target Milestone|4.1.2 |4.1.3 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28709
[Bug preprocessor/28709] [4.0/4.1 regression] Bad diagnostic pasting tokens with ##
--- Comment #6 from gdr at gcc dot gnu dot org 2007-02-03 18:54 --- Won't fix in GCC-4.0.x. Adjusting milestone. -- gdr at gcc dot gnu dot org changed: What|Removed |Added Target Milestone|4.0.4 |4.1.3 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28709
[Bug preprocessor/28709] [4.0/4.1 regression] Bad diagnostic pasting tokens with ##
-- pinskia at gcc dot gnu dot org changed: What|Removed |Added Target Milestone|4.1.3 |4.1.2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28709
[Bug preprocessor/28709] [4.0/4.1 regression] Bad diagnostic pasting tokens with ##
--- Comment #5 from patchapp at dberlin dot org 2007-01-01 21:57 --- Subject: Bug number PR preprocessor/28709 A patch for this bug has been added to the patch tracker. The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2006-12/msg01852.html -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28709
[Bug preprocessor/28709] [4.0/4.1 regression] Bad diagnostic pasting tokens with ##
--- Comment #4 from tromey at gcc dot gnu dot org 2006-12-28 04:22 --- FWIW what happens here is that 'foo;' is turned into '- ;' by cpp; then the second error is emitted by the C parser. You can easily see this by comparing the -E output against the --syntax-only output. The problem here is that paste_tokens backs up over the '' token, but it leaves the half-pasted '-' token in *plhs. I have a fix that I'm testing. -- tromey at gcc dot gnu dot org changed: What|Removed |Added CC||tromey at gcc dot gnu dot ||org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28709
[Bug preprocessor/28709] [4.0/4.1 regression] Bad diagnostic pasting tokens with ##
--- Comment #3 from reichelt at gcc dot gnu dot org 2006-10-23 20:41 --- Just a minor nit: The second error message still contains the - token which should not have been generated. But that's probably tolerable. bug.c:2:1: error: pasting - and does not give a valid preprocessing token bug.c:2: error: expected identifier or '(' before '-' token -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28709