In the last episode (Oct 03), Larry Lile said:
> 
>     ...we get scores of warnings about using characters as subscripts
>     to an array (-Wchar-subscripts), which generates so much noise as
>     to mask real warnings burried within. Therefore, I would like to
>     suppress this warning unless someone can explain why using a char
>     as an array subscript is in any way an illegitimate thing to do.
>     As far as I can tell, getting rid of the warning by changing the
>     code would require adding a large number of frivolous casts to
>     scores of source files...
> 
> So why is using a "char" as an array subscript wrong?  I had always
> avoided it because the compiler complained and that was good enough
> for me.

Because your char value could be negative and end up referencing memory
before your array start.  Mainly a problem with the ctype macros and
high-ascii characters.

-- 
        Dan Nelson
        [EMAIL PROTECTED]


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to