On Tue, Jul 23, 2002 at 02:56:57PM +0000, Andy Dougherty wrote: > # New Ticket Created by Andy Dougherty > # Please include the string: [perl #15401] > # in the subject line of all future correspondence about this issue. > # <URL: http://rt.perl.org/rt2/Ticket/Display.html?id=15401 > > > > This patch eliminates 69 warnings of the form > > debug.c:96: warning: subscript has type `char' > > from gcc-2.8.1 on Solaris 8. > > The isXXXX() functions take 'int' arguments (since they must operate > either on characters or EOF). On Solaris 8, under the default > compilation conditions for me with gcc, they are implemented as > lookup-tables, with the 'character' used as the index. Hence normal > type promotion isn't performed and the 'subscript has type char' > warning gets issued.
Having just RTFM: DESCRIPTION These functions check whether c, which must have the value of an unsigned char or EOF, falls into a certain character class according to the current locale. we are being naughty passing plain char to <ctype.h>'s is* functions. I'm not sure if we ever pass these functions characters between 128 and 255, er I mean -128 and -1, (you see the problem?) but if we do we're being naughty. And probably getting garbage back as we fall off the beginning of the lookup table. Except on nice platforms where plain char is unsigned (ARM, PPC are the only two I know of) Nicholas Clark