Ralph Corderoy <[email protected]> writes:
>>> extern int ctype_identity[257]; /* [n] = n-1 */
>>> #define isupper(c) ((isupper)((ctype_identity + 1)[c]))
>> I'm not sure what the point is here, but have you considered that the
>> input might be either signed or unsigned char? If it's signed, this
>> coding won't work.
> IIRC from the git commit log, this is attributed as your idea. :-) The
> compiler will warn if type char is used as an array index, regardless of
> whether it's signed or unsigned here, because it might be signed
> elsewhere and the code wouldn't work as expected. So the above needs c
> to be of type unsigned char, for example, to avoid the compiler warning.
> It's the warning we're after to catch `isdigit(*s)' instead of
> `isdigit((unsigned char)*s)'.
Ah, I see. In the Postgres project we're relying on specific buildfarm
members whose ctype.h macros actually still use arrays to catch this.
Putting in your own layer is a cute idea. If I suggested it, it must've
come from a brain cell I don't have anymore.
regards, tom lane
_______________________________________________
Nmh-workers mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/nmh-workers