isascii (was: Another pitfall. Signed chars and ctype.h)
Karl Heuer
karl at haddock.ima.isc.com
Mon Feb 26 14:55:00 AEST 1990
In article <680020 at hpmwjaa.HP.COM> jeffa at hpmwtd.HP.COM (Jeff Aguilera) writes:
>[Ray Butterworth wrote:]
>> [If isascii() were guaranteed for *all* characters,]
>> Then the missing isascii() wouldn't even be needed.
>> This was proposed to the Committee and rejected on the (incorrect)
>> grounds that it [would make the macro unsafe].
>
>Introduce the inline keyword, and then inline all the ctype functions.
>Simple solution, superior in all respects.
Unnecessary, since (as Ray noted) the unsafe-macro argument was *incorrect*:
the macro version would still evaluate the argument exactly once.
Insufficient, since (as I noted earlier) the real problem is with the
collision between signed chars and EOF. This is a problem with the
specification itself, regardless of whether or not it's implemented as a
macro.
>(Gawd, ANSI C is brain dead.)
I suppose it is, but not because of anything you've said here. I blame it on
heredity; pre-ANSI C was worse.
Karl W. Z. Heuer (karl at ima.ima.isc.com or harvard!ima!karl), The Walking Lint
More information about the Comp.lang.c
mailing list