From 39a559578e0fc5937baa2d07cf17990c305b7cba Mon Sep 17 00:00:00 2001 From: marcel Date: Mon, 18 Feb 2008 20:01:33 +0000 Subject: 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... --- bin/sh/mksyntax.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'bin/sh') 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) -- cgit v1.1