This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]