Tom Lane writes:
> - if (isascii((unsigned char)lower_text[i]) && isupper(lower_text[i]))
> + if (isascii((int)lower_text[i]) && isupper((int) lower_text[i]))
> Peter, I suppose what you were trying to clean up is a "char used as
> array subscript" kind of warning?
Yep.
> I would like to think that your compiler will not complain about
> if (isascii((unsigned char)lower_text[i]) ...
> If it does we'd have to write something as ugly as
> if (isascii((int)(unsigned char)lower_text[i]) ...
> which I can see no value in from a portability standpoint.
I think that the problem might rather be that lower_text (and various
other arrays) are not declared as unsigned char in the first place. That
would also explain why -funsigned-chars fixes it. Because calling
toupper() etc. with a signed char argument is in violation of the spec.
(Hmm, template/aix contains this: CFLAGS='-qchars=signed ...'. That can't
be good.)
--
Peter Eisentraut peter_e@gmx.net http://yi.org/peter-e/