public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeffrey A Law <law@cygnus.com>
To: Neil Booth <NeilB@earthling.net>
Cc: Byron Stanoszek <gandalf@winds.org>,
	geoffk@cygnus.com, gcc@gcc.gnu.org, gcc-patches@gcc.gnu.org,
	jakub@redhat.com
Subject: Re: warning: pasting would not give a valid preprocessing token
Date: Thu, 14 Sep 2000 16:08:00 -0000	[thread overview]
Message-ID: <7437.968972879@upchuck> (raw)
In-Reply-To: <20000914235302.A9969@daikokuya.demon.co.uk>

  In message < 20000914235302.A9969@daikokuya.demon.co.uk >you write:
  > [There's no point cc-ing Zack; his mail address is no more]
  > 
  > Byron,
  > 
  > I hope this fixes it for you.  I'm bootstrapping now, and will then
  > run the testsuite.
  > 
  > This area is a bit ugly and in bad need of a cleanup.  I need to
  > extract more flexibility from the lexer first, though.  The problem
  > was in the way we handle macro arguments: each argument is a list of
  > pointers to the tokens making up the argument.  These tend to point to
  > the original tokens (in this case, the comma in the macro definition
  > in the hash table).  That token has a PASTE_LEFT flag to say it's on
  > the left hand side of a ##.  The problem is that after processing the
  > paste, and correctly not emitting a warning about invalid pastes, we
  > maintained a pointer to the same comma for the nested macro
  > replacements (since it is part of an argument itself).  Unforunately,
  > of course, that comma still has its paste flag set, so the paste
  > mechanism gets re-invoked in later unintended places; hence the
  > (repeated) warnings.
  > 
  > This is a nice testcase for quite a deep nested macro bug.  I
  > simplified your case to the one below, which I'll commit along with
  > the fix.  If you have a chance, please give it a whirl.
  > 
  > It also fixes a bug in ON_REST_ARG - the macro was testing the flags
  > of the wrong thing (easy to do since #defines are typeless).  Any
  > relief the original fix brought might therefore be undone; I'd be
  > interested in knowing if the warnings it "cured" come back with this
  > patch.
  > 
  > OK to commit?
  > 
  > Neil.
  > 
  > 	* cpplex.c (ON_REST_ARG): Correct the test.
  > 	(maybe_paste_with_next): Duplicate a token that fail pasting,
  > 	and clear its PASTE_LEFT flag, so that nested pasting attempts
  > 	do not occur.
  > 	* gcc.dg/cpp/paste10.c: Testcase.
Assuming the bootstrap & test passes, this is fine to install.

jeff

  parent reply	other threads:[~2000-09-14 16:08 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20000914185040.A12722@daikokuya.demon.co.uk>
     [not found] ` <Pine.LNX.4.21.0009141510140.21092-201000@winds.org>
2000-09-14 15:53   ` Neil Booth
2000-09-14 16:02     ` Neil Booth
2000-09-14 16:08     ` Jeffrey A Law [this message]
2000-09-15 16:53     ` Byron Stanoszek
2000-08-11 20:41 Byron Stanoszek
2000-08-11 20:46 ` Geoff Keating
2000-08-11 20:58   ` Byron Stanoszek
2000-08-11 23:31     ` Zack Weinberg
2000-08-12  8:19       ` Byron Stanoszek
2000-09-06 19:18         ` Zack Weinberg
2000-09-07 12:04           ` Byron Stanoszek
2000-09-11 21:44             ` Zack Weinberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7437.968972879@upchuck \
    --to=law@cygnus.com \
    --cc=NeilB@earthling.net \
    --cc=gandalf@winds.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=gcc@gcc.gnu.org \
    --cc=geoffk@cygnus.com \
    --cc=jakub@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).