Date: Wed, 27 Jan 1999 18:22:13 -0800 (PST) From: Archie Cobbs <archie@whistle.com> To: bright@hotjobs.com (Alfred Perlstein) Cc: current@FreeBSD.ORG Subject: Re: kern/subr_scanf array index of signed char Message-ID: <199901280222.SAA20135@bubba.whistle.com> In-Reply-To: <Pine.BSF.4.05.9901272113380.81323-100000@bright.fx.genx.net> from Alfred Perlstein at "Jan 27, 99 09:14:22 pm"
index | next in thread | previous in thread | raw e-mail
Alfred Perlstein writes:
> > Matthew Dillon writes:
> > > - while (ccltab[*inp]) {
> > > + while (ccltab[(int)(unsigned char)*inp]) {
> >
> > Just curious.. why do you need the "(int)" cast?
>
> avoids a warning.
No it doesn't. The "(unsigned char)" avoids the warning:
$ cat > foo.c
int foo(int *array, unsigned char index) { return array[index]; }
$ gcc -c -Wall -o foo foo.c
$
-Archie
___________________________________________________________________________
Archie Cobbs * Whistle Communications, Inc. * http://www.whistle.com
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message
home |
help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199901280222.SAA20135>
