Subject: weird lossage with xcompile macppc -> sparc
To: None <tech-toolchain@netbsd.org>
From: matthew green <mrg@eterna.com.au>
List: tech-toolchain
Date: 09/21/2002 16:15:02
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;
	else
		sign = 0;

	[ ... ]

	if (sign)
		fprintf(hfile, "#define UPEOF ((char)%d)\n\n", -base);
	else
		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.

any one have ideas why?  this is with fairly recently (<2 day old)
sources...



.mrg.