Re: [PATCH] sequencer: silence -Wtautological-constant-out-of-range-compare
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Nov 9, 2016, 13:54 UTC
- Message-ID
- <alpine.DEB.2.20.1611091453580.72596@virtualbox>
- In-Reply-To
- <20161109035728.v2mqvtj4ep4dj74j@sigill.intra.peff.net>
Hi Peff,
On Tue, 8 Nov 2016, Jeff King wrote:
Show 12 quoted lines
> diff --git a/sequencer.c b/sequencer.c
> index 5fd75f30d..6f0ff9e41 100644
> --- a/sequencer.c
> +++ b/sequencer.c
> @@ -629,7 +629,7 @@ static const char *todo_command_strings[] = {
>
> static const char *command_to_string(const enum todo_command command)
> {
> - if (command < ARRAY_SIZE(todo_command_strings))
> + if ((size_t)command < ARRAY_SIZE(todo_command_strings))
> return todo_command_strings[command];
> die("Unknown command: %d", command);I have come to prefer a slightly different approach. Will send it out in a moment.
Ciao, Dscho