From: Pedro Alves <palves@redhat.com>
To: Tom Tromey <tom@tromey.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFA] Add support for __VA_OPT__
Date: Thu, 21 Sep 2017 09:01:00 -0000 [thread overview]
Message-ID: <63ab0211-8160-7ef2-5c9d-cfe5e85f9258@redhat.com> (raw)
In-Reply-To: <874lrwsonf.fsf@tromey.com>
On 09/21/2017 04:42 AM, Tom Tromey wrote:
> Pedro> The patch looks good to me, though I think it'd be nice to see
> Pedro> tests that make sure that ill-formed input doesn't send us
> Pedro> to the weeds. Like:
> Pedro> - does the state machine handle "__VA_OPT__)" gracefully?
> Pedro> I.e., ')' before '('.
> Pedro> - similarly: "__VA_OPT__)(,)"
> Pedro> - does the state machine handle multiple occurrences of
> Pedro> __VA_OPT__ in the same macro expansion? It looks like
> Pedro> it, but....
> Pedro> Also, does this handle:
> Pedro> __VA_OPT__(__VA_ARGS__)
> Pedro> correctly? I think so, but...
>
> I've added all of these.
Great, thanks!
>
> But I wonder if gdb should just error() on the invalid ones.
> My first thought was no, why make life harder -- but at the same time,
> the invalid cases really aren't that useful either.
Yeah, error might be better - e.g., for someone trying
to write a "macro define" interactively (without
going via the compiler first), and puzzling about why it
doesn't exactly work [due to some typo]. But we can
decide to do that incrementally. Fine with me to push
as is if you'd like.
Thanks,
Pedro Alves
next prev parent reply other threads:[~2017-09-21 9:01 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-18 2:42 Tom Tromey
2017-09-20 16:43 ` Pedro Alves
2017-09-21 3:42 ` Tom Tromey
2017-09-21 9:01 ` Pedro Alves [this message]
2017-09-23 3:03 ` Tom Tromey
2017-09-27 11:32 ` Pedro Alves
2017-09-27 14:19 ` 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=63ab0211-8160-7ef2-5c9d-cfe5e85f9258@redhat.com \
--to=palves@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=tom@tromey.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