Re: [PATCH] sequencer: silence -Wtautological-constant-out-of-range-compare

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Peff,

On Tue, 8 Nov 2016, Jeff King wrote:

> 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



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]