From: Andreas Schwab <schwab@suse.de>
To: Pedro Alves <pedro@codesourcery.com>
Cc: gdb-patches@sourceware.org, tromey@redhat.com
Subject: Re: RFA: fix macro expansion bug
Date: Thu, 11 Dec 2008 23:31:00 -0000 [thread overview]
Message-ID: <jeabb2p9w0.fsf@sykes.suse.de> (raw)
In-Reply-To: <200812112304.39302.pedro@codesourcery.com> (Pedro Alves's message of "Thu, 11 Dec 2008 23:04:38 +0000")
Pedro Alves <pedro@codesourcery.com> writes:
> Though, I'm having a bit of trouble convincing myself that the logic to
> handle 'pp-number e|E|p|P|. sign' below is 100% sane.
>
> static int
> get_pp_number (struct macro_buffer *tok, char *p, char *end)
> {
> ...
> while (p < end)
> {
> if (macro_is_digit (*p)
> || macro_is_identifier_nondigit (*p)
> || *p == '.')
> p++;
> else if (p + 2 <= end
> && strchr ("eEpP.", *p)
> && (p[1] == '+' || p[1] == '-'))
> p += 2;
> else
> break;
> }
>
> It seems macro_is_identifier_nondigit will always eat any of "eEpP",
> thus, say, when parsing "1e-" only "1e" will be identified as a pp
> number, leaving "+" in the stream. Is this right?
Also, a sign can only follow [eEpP], but not [.].
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, MaxfeldstraÃe 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
next prev parent reply other threads:[~2008-12-11 23:31 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-11 21:37 Tom Tromey
2008-12-11 23:05 ` Pedro Alves
2008-12-11 23:28 ` Tom Tromey
2008-12-11 23:35 ` Pedro Alves
2008-12-12 17:07 ` Tom Tromey
2008-12-11 23:31 ` Andreas Schwab [this message]
2008-12-11 23:41 ` Tom Tromey
2008-12-11 23:51 ` Pedro Alves
2008-12-11 23:58 ` Tom Tromey
2008-12-12 17:02 ` Tom Tromey
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=jeabb2p9w0.fsf@sykes.suse.de \
--to=schwab@suse.de \
--cc=gdb-patches@sourceware.org \
--cc=pedro@codesourcery.com \
--cc=tromey@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