Subject: Re: weird lossage with xcompile macppc -> sparc
To: matthew green <firstname.lastname@example.org>
From: Bill Studenmund <email@example.com>
Date: 09/23/2002 16:15:18
On Sat, 21 Sep 2002, matthew green wrote:
> hi folks.
> i'm having a weird problem with bin/sh building cross from macppc
> to sparc. i am getting this:
> /usr/src/bin/sh/eval.c: In function `evalcommand':
> /usr/src/bin/sh/eval.c:641: warning: comparison is always true due to limited range of data type
> /usr/src/bin/sh/eval.c:644: warning: comparison is always true due to limited range of data type
> because a "signedness" test in mksyntax.c fails somehow:
> /* Determine the characteristics of chars. */
> c = -1;
> if (c <= 0)
> sign = 1;
> sign = 0;
> [ ... ]
> if (sign)
> fprintf(hfile, "#define UPEOF ((char)%d)\n\n", -base);
> fprintf(hfile, "#define UPEOF ((unsigned char)%d)\n\n", -base);
> and UPEOF() is the macro involved above that causes the warning. it
> gets defined with a cast to "unsigned char" as sign gets set to 0.
Do a cc -E on the compile of mksyntax. See what type "c" is getting
defined to. It SHOULD be int8_t, and thus you should be getting "signed"
set to one.