PATCH: avoid warnings on array[CHAR_CONSTANT]

Jonathan Lennox lennox@cs.columbia.edu
Mon Jun 9 19:56:00 GMT 2003


Eddie Kohler writes:
> The following patch avoids the "array subscript has type `char'" warning in
> C++ when the subscript is a character constant with value between 0 and
> 127. This supports the following common usage pattern:

Shouldn't this be based on the target's SCHAR_MAX, instead?  GCC supports
platforms with 9-bit bytes.

Also, you'd need testcases, of course.

-- 
Jonathan Lennox
lennox at cs dot columbia dot edu



More information about the Gcc-patches mailing list