summaryrefslogtreecommitdiff
path: root/src/uniq.c
diff options
context:
space:
mode:
authorJim Meyering <meyering@fb.com>2015-10-15 09:09:18 -0700
committerJim Meyering <meyering@fb.com>2015-10-16 08:02:51 -0700
commite8d7e205309c05cf2c7c9a42b33708b1eb4587ca (patch)
tree2d8069320a668216abd082c05e2f2921157e45f7 /src/uniq.c
parentc249a5afc4f480e10346198422a3161931afd574 (diff)
downloadcoreutils-e8d7e205309c05cf2c7c9a42b33708b1eb4587ca.tar.xz
maint: avoid uniq.c warning from bleeding-edge gcc's -Wstrict-overflow
* src/uniq.c (main): Make the type of "nfiles" unsigned, to avoid a brand new warning from a gcc I built from today's sources (gcc version 6.0.0 20151015 (experimental) (GCC)): src/uniq.c:523:14: error: assuming signed overflow does not occur \ when simplifying conditional to constant [-Werror=strict-overflow] if (nfiles == 2) ^
Diffstat (limited to 'src/uniq.c')
-rw-r--r--src/uniq.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/uniq.c b/src/uniq.c
index 8dfb7ea97..7b77dd3b0 100644
--- a/src/uniq.c
+++ b/src/uniq.c
@@ -483,7 +483,7 @@ main (int argc, char **argv)
int optc = 0;
bool posixly_correct = (getenv ("POSIXLY_CORRECT") != NULL);
enum Skip_field_option_type skip_field_option_type = SFO_NONE;
- int nfiles = 0;
+ unsigned int nfiles = 0;
char const *file[2];
char delimiter = '\n'; /* change with --zero-terminated, -z */
bool output_option_used = false; /* if true, one of -u/-d/-D/-c was used */