This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: avoid warnings on array[CHAR_CONSTANT]
- From: Eddie Kohler <kohler at icir dot org>
- To: Richard Henderson <rth at redhat dot com>
- Cc: Mike Stump <mrs at apple dot com>, gcc-patches at gcc dot gnu dot org, Jonathan Lennox <lennox at cs dot columbia dot edu>
- Date: Wed, 11 Jun 2003 15:34:11 -0700
- Subject: Re: PATCH: avoid warnings on array[CHAR_CONSTANT]
> > It doesn't invalidate the patch itself though, right?
>
> It does in that you're led to believe that a['A'] is safe.
Compiling on an (8-bit) EBCDIC machine would still produce a warning on
"a['A']", regardless of whether char was signed. So the warning still helps
you when you need it -- namely, when you compile under EBCDIC.
And most 'casual' programs written for ASCII don't work under EBCDIC
regardless. GCC doesn't warn on "c >= 'A' && c <= 'Z'"; it could, and that
code is almost always wrong under EBCDIC, but...
I think that warning on "a['A']" is a real lose in practice. And, again, C
does not produce a warning. Could you be convinced that the patch is
worthwhile?
Eddie