From: Pádraig Brady
Date: Sat, 16 Dec 2017 21:07:43 +0000 (-0800) Subject: build: avoid a signed overflow warning in ptx X-Git-Tag: v8.29~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a1300c60efef1ee1b9e04d6834cb6d3eda16f31d;p=thirdparty%2Fcoreutils.git build: avoid a signed overflow warning in ptx * 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). --- diff --git a/src/ptx.c b/src/ptx.c index 58e6c57c8a..02bf8ebb04 100644 --- a/src/ptx.c +++ b/src/ptx.c @@ -1194,7 +1194,7 @@ print_field (BLOCK field) static void fix_output_parameters (void) { - int file_index; /* index in text input file arrays */ + size_t file_index; /* index in text input file arrays */ intmax_t line_ordinal; /* line ordinal value for reference */ ptrdiff_t reference_width; /* width for the whole reference */ int character; /* character ordinal */