Subject: Re: gcc-current and warnings in bin/sh
To: None <tech-userlevel@netbsd.org>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: tech-userlevel
Date: 05/31/2002 15:24:53
> /u1/netbsd/src/bin/sh/eval.c:641: warning: comparison is always true due to limited range of data type
> /u1/netbsd/src/bin/sh/eval.c:644: warning: comparison is always true due to limited range of data type
[...]

> -		if (varflag && is_name(*p)) {
> +		int c;
> +		if (varflag && is_name((c = *p))) {
[...]
> -			} while (is_in_name(*p));
> +			} while (is_in_name((c = *p)));

Quite aside from the problem itself, which another message makes me
think has already been fixed, I'd remark that you don't need another
variable for something like this; a cast should be quite enough:

	if (varflag && is_name((int)*p)) {
...
		} while (is_in_name((int)*p));

Of course, you may want the variable for other reasons, but the patch
doesn't give me any reason to think that's so here.

/~\ The ASCII				der Mouse
\ / Ribbon Campaign
 X  Against HTML	       mouse@rodents.montreal.qc.ca
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B