From owner-freebsd-arch Mon Nov 29 11:38:10 1999 Delivered-To: freebsd-arch@freebsd.org Received: from ns1.yes.no (ns1.yes.no [195.204.136.10]) by hub.freebsd.org (Postfix) with ESMTP id 20FD114D50 for ; Mon, 29 Nov 1999 11:38:07 -0800 (PST) (envelope-from eivind@bitbox.follo.net) Received: from bitbox.follo.net (bitbox.follo.net [195.204.143.218]) by ns1.yes.no (8.9.3/8.9.3) with ESMTP id UAA23049 for ; Mon, 29 Nov 1999 20:38:06 +0100 (CET) Received: (from eivind@localhost) by bitbox.follo.net (8.8.8/8.8.6) id UAA65748 for freebsd-arch@freebsd.org; Mon, 29 Nov 1999 20:38:06 +0100 (MET) Received: from apollo.backplane.com (apollo.backplane.com [216.240.41.2]) by hub.freebsd.org (Postfix) with ESMTP id 84B3A14D50 for ; Mon, 29 Nov 1999 11:37:57 -0800 (PST) (envelope-from dillon@apollo.backplane.com) Received: (from dillon@localhost) by apollo.backplane.com (8.9.3/8.9.1) id LAA08363; Mon, 29 Nov 1999 11:37:56 -0800 (PST) (envelope-from dillon) Date: Mon, 29 Nov 1999 11:37:56 -0800 (PST) From: Matthew Dillon Message-Id: <199911291937.LAA08363@apollo.backplane.com> To: Bill Fumerola Cc: Martin Cracauer , arch@freebsd.org Subject: Re: What to do about "subscript has type `char'" warnings? References: Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG : :On Mon, 29 Nov 1999, Matthew Dillon wrote: : :> :b) or cast :> : char *s = syntax[2]; :> : string[(int)*s]; : :I would suggest using this option and I will be using this in some :of my -Wall fixes I have in the pipeline. : :-- :- bill fumerola - billf@chc-chimes.com - BF1560 - computer horizons corp - That useage is not portable unless you can guarentee that the characters in the specified string range only from 0-127. These useages would be portable: string[(unsigned char)*s]; string[(int)(unsigned char)*s]; string[(int)(signed char)*s]; -Matt Matthew Dillon To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message