summaryrefslogtreecommitdiff
path: root/src/ptx.c
diff options
context:
space:
mode:
authorJim Meyering <meyering@fb.com>2016-08-28 22:53:50 -0700
committerJim Meyering <meyering@fb.com>2016-08-29 08:37:08 -0700
commitd591776d81c547ef9a24b95fc88698593d81d5e7 (patch)
tree4a35ec73ec94e204427e57ff6cbf82faca78ac6c /src/ptx.c
parentbd75118c16d8bca235b61dbb99326c043278a791 (diff)
downloadcoreutils-d591776d81c547ef9a24b95fc88698593d81d5e7.tar.xz
ptx: avoid new warning/error from upcoming gcc-7.x
* src/ptx.c (fix_output_parameters): Switch to an unsigned type that matches the OCCURS.file_index type. This avoids the following error from gcc-7.0.0 20160829 (experimental): src/ptx.c:1220:14: error: assuming signed overflow does not occur \ when simplifying conditional to constant [-Werror=strict-overflow] if (file_index > 0)
Diffstat (limited to 'src/ptx.c')
-rw-r--r--src/ptx.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ptx.c b/src/ptx.c
index d19c66e40..1f0e9c921 100644
--- a/src/ptx.c
+++ b/src/ptx.c
@@ -1200,7 +1200,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 */
int line_ordinal; /* line ordinal value for reference */
char ordinal_string[12]; /* edited line ordinal for reference */
int reference_width; /* width for the whole reference */