From owner-freebsd-current Wed Jan 27 18:22:56 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id SAA20074 for freebsd-current-outgoing; Wed, 27 Jan 1999 18:22:56 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from whistle.com (s205m131.whistle.com [207.76.205.131]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id SAA20061 for ; Wed, 27 Jan 1999 18:22:51 -0800 (PST) (envelope-from archie@whistle.com) Received: (from smap@localhost) by whistle.com (8.7.5/8.6.12) id SAA25643; Wed, 27 Jan 1999 18:22:22 -0800 (PST) Received: from bubba.whistle.com( 207.76.205.7) by whistle.com via smap (V2.0) id xma025637; Wed, 27 Jan 99 18:22:13 -0800 Received: (from archie@localhost) by bubba.whistle.com (8.8.7/8.6.12) id SAA20135; Wed, 27 Jan 1999 18:22:13 -0800 (PST) From: Archie Cobbs Message-Id: <199901280222.SAA20135@bubba.whistle.com> Subject: Re: kern/subr_scanf array index of signed char In-Reply-To: from Alfred Perlstein at "Jan 27, 99 09:14:22 pm" To: bright@hotjobs.com (Alfred Perlstein) Date: Wed, 27 Jan 1999 18:22:13 -0800 (PST) Cc: current@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL38 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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