diff options
author | marcel <marcel@FreeBSD.org> | 2008-02-18 20:01:33 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2008-02-18 20:01:33 +0000 |
commit | 39a559578e0fc5937baa2d07cf17990c305b7cba (patch) | |
tree | dded58b34322642f74497a9716821204ed22fc01 /bin/sh/mksyntax.c | |
parent | be6b4b9b616cc7d00e7671e3563ab0907db86fec (diff) | |
download | FreeBSD-src-39a559578e0fc5937baa2d07cf17990c305b7cba.zip FreeBSD-src-39a559578e0fc5937baa2d07cf17990c305b7cba.tar.gz |
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...
Diffstat (limited to 'bin/sh/mksyntax.c')
-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 6966ae0..e4ec28a 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) |