This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] Add support for __VA_OPT__


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]