diff options
author | Marcel Moolenaar <marcel@FreeBSD.org> | 2008-02-18 20:01:33 +0000 |
---|---|---|
committer | Marcel Moolenaar <marcel@FreeBSD.org> | 2008-02-18 20:01:33 +0000 |
commit | 2912059a8548d24fbbee95bc80ec4af6e24d7246 (patch) | |
tree | dded58b34322642f74497a9716821204ed22fc01 /bin | |
parent | 0943a3b7ec6993b6fbfbb2b5118f33468b028429 (diff) | |
download | src-2912059a8548d24fbbee95bc80ec4af6e24d7246.tar.gz src-2912059a8548d24fbbee95bc80ec4af6e24d7246.zip |
Fix "warning: comparison is always false due to limited range of data type"
on platforms with unsigned chars. The comparison in question is there to
determine whether chars are unsigned or not and is based on comparing a
char, initialized to -1, for less than 0. Change the comparison to check
for geater than 0 instead...
Notes
Notes:
svn path=/head/; revision=176392
Diffstat (limited to 'bin')
-rw-r--r-- | bin/sh/mksyntax.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/bin/sh/mksyntax.c b/bin/sh/mksyntax.c index 6966ae058987..e4ec28aa53d1 100644 --- a/bin/sh/mksyntax.c +++ b/bin/sh/mksyntax.c @@ -139,10 +139,7 @@ main(int argc __unused, char **argv __unused) /* Determine the characteristics of chars. */ c = -1; - if (c < 0) - sign = 1; - else - sign = 0; + sign = (c > 0) ? 0 : 1; for (nbits = 1 ; ; nbits++) { d = (1 << nbits) - 1; if (d == c) |