coreutils
[Top][All Lists]
Advanced

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

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


From: Pádraig Brady
Subject: [PATCH] build: avoid a signed overflow warning in ptx
Date: Sat, 16 Dec 2017 13:11:35 -0800

* 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).
---
 src/ptx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/ptx.c b/src/ptx.c
index 58e6c57..02bf8eb 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 */
-- 
2.9.3




reply via email to

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