This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] Add support for __VA_OPT__
On 09/23/2017 04:03 AM, Tom Tromey wrote:
>>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:
>
>>> 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.
>
> Pedro> Yeah, error might be better - e.g., for someone trying
> Pedro> to write a "macro define" interactively (without
> Pedro> going via the compiler first), and puzzling about why it
> Pedro> doesn't exactly work [due to some typo]. But we can
> Pedro> decide to do that incrementally. Fine with me to push
> Pedro> as is if you'd like.
>
> I've switched it; and good thing, too, because this caught a bug in the
> previous patch that could cause an infinite loop.
>
Nice. Patch looks good. Please push.
> + /* Whether the loop should keep going. */
> + bool keep_going = true;
'keep_going' doesn't appear used after the loop. Could it be
declared in the for's init statement ?
for (bool keep_going = true;
keep_going;
...
> +
> + for (;
> + keep_going;
> + get_next_token_for_substitution (&replacement_list,
> + &tok,
> + &original_rl_start,
> + &lookahead,
> + &lookahead_rl_start,
> + &lookahead_valid,
> + &keep_going))
> {
Thanks,
Pedro Alves