Re: [RFA_v4 2/8] Implement frame apply [all | COUNT | -COUNT | level LEVEL... ] [FLAG]... COMMAND.

Tom Tromey
2018-07-14T12:37:47Z

>>>>> "Simon" == Simon Marchi <simark@simark.ca> writes:

Simon> Hi Philippe,
Simon> On 2018-07-10 05:39 PM, Philippe Waroquiers wrote:
>> +/* Implementation of the "frame apply level" command. */
>> +
>> +static void
>> +frame_apply_level_command (const char *cmd, int from_tty)
>> +{
>> + if (!target_has_stack)
>> + error (_("No stack."));
>> +
>> + bool level_found = false;
>> + const char *levels_str = cmd;
>> + number_or_range_parser levels (levels_str);
>> +
>> + /* Skip the LEVEL list to find the flags and command args. */
>> + while (!levels.finished ())
>> + {
>> + const int level_beg = levels.get_number ();

Simon> This variable is unused, so is caught by Tom's -Wunused-variable patch.
Simon> Is it just ok to remove the local variable and the assignment (but keep
Simon> the call)?

That's what I have in my most recent patch.
get_number advances through the arguments, so it must be called. But,
the result isn't used in this loop, but rather when the arguments are
re-parsed later.

Tom