Subject: Re: weird lossage with xcompile macppc -> sparc
To: None <tech-toolchain@netbsd.org>
From: David Laight <david@l8s.co.uk>
List: tech-toolchain
Date: 09/22/2002 20:27:21
On Sat, Sep 21, 2002 at 11:07:27AM +0200, Martin Husemann wrote:
> On Sat, Sep 21, 2002 at 04:15:02PM +1000, matthew green wrote:
> 
> > because a "signedness" test in mksyntax.c fails somehow:
> 
> Uhmm, mksyntax is run as a host program, so it determines the hosts char
> signedness. borken.
> 
> > 	if (sign)
> > 		fprintf(hfile, "#define UPEOF ((char)%d)\n\n", -base);
> > 	else
> > 		fprintf(hfile, "#define UPEOF ((unsigned char)%d)\n\n", -base);
> 
> And I must be missing something here: if "char" is signed, use 
> 
>  ((char)-1)
> 
> if char is unsigned, use
> 
>  ((unsigned char)-1) 
> 
> Isn't the "unsigned" in the latter case redundant anyway?

I did look at this definition while breaking (ie attempting to fix)
'sh' after if caused other problems.
IIRC UPEOF is only used inside the defines is_name(), is_in_name()
and is_alnum().  is_alnum() isn't used at all, and if the other
cases the argument is almost never 'EOF'.

	David

-- 
David Laight: david@l8s.co.uk