Building with GCC 7, here's a fix for one of the new warnings:
From 9403b93c15ec2ed8fdc7c993263260a91e6b4e8c Mon Sep 17 00:00:00 2001
From: Jim Meyering <[email protected]>
Date: Wed, 14 Sep 2016 11:48:33 -0700
Subject: [PATCH] maint: pr: avoid new GCC 7 warning

* src/pr.c (main): Avoid this warning from GCC 7:
src/pr.c:1119:6: error: assuming signed overflow does not occur when \
  simplifying conditional to constant [-Werror=strict-overflow]
   if (n_files == 0)
---
 src/pr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/pr.c b/src/pr.c
index d4549a3..a22d550 100644
--- a/src/pr.c
+++ b/src/pr.c
@@ -847,7 +847,7 @@ separator_string (const char *optarg_S)
 int
 main (int argc, char **argv)
 {
-  int n_files;
+  unsigned int n_files;
   bool old_options = false;
   bool old_w = false;
   bool old_s = false;
-- 
2.7.4

Reply via email to