git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

Previous: Jeff King
Message 2 of 2 in “sequencer: silence -Wtautological-constant-out-of-range-compare”
  1. sequencer: silence -Wtautological-constant-out-of-range-compareJeff King, Nov 9, 2016
  2. Johannes SchindelinNov 9, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.