coreutils
[Top][All Lists]
Advanced

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

Re: [PATCH] build: avoid a signed overflow warning in ptx


From: Erik Auerswald
Subject: Re: [PATCH] build: avoid a signed overflow warning in ptx
Date: Sun, 17 Dec 2017 17:28:45 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

Hi,

On Sat, Dec 16, 2017 at 01:11:35PM -0800, Pádraig Brady wrote:
> * src/ptx.c (fix_output_parameters): GCC 6.3.1 with
> ./configure --enable-single-binary would give:
>   error: assuming signed overflow does not occur
>   when simplifying conditional to constant [-Werror=strict-overflow]
>     if (file_index > 0)
> So change the type of file_index to signed (size_t).

But you changed it from _signed_ (int) to _unsigned_ (size_t), right?

> [...]
> -  int file_index;            /* index in text input file arrays */
> +  size_t file_index;         /* index in text input file arrays */

Thanks,
Erik
-- 
Golden rule #12: When the comments do not match the code, they probably
                 are both wrong.
                        -- Steven Rostedt



reply via email to

[Prev in Thread] Current Thread [Next in Thread]