_tolower and _toupper macros
Michael Meissner
meissner at osf.org
Sat Jul 28 14:07:55 AEST 1990
In article <246 at audfax.audiofax.com> arnold at audiofax.com (Arnold Robbins) writes:
| I guess tolower() and toupper() remain real functions in V.3.2 in case
| anyone takes their address; I can't see any other reason to not have them
| be macros identical to their _to* counterparts.
No, I think it's more that the normal way to implement a real toupper
or tolower as macros evalulates the argument 2 times (one for the
test, and once for either side of the ?:). I seem to remember coming
on some real live System V code that breaks if the argument is
evaluated more than once. Of course with internationalization these
days, the way to implement tolower/toupper is through a 257 element
array. Using the array also only evaluates the argument once if
implemented as a macro.
--
Michael Meissner email: meissner at osf.org phone: 617-621-8861
Open Software Foundation, 11 Cambridge Center, Cambridge, MA
Do apple growers tell their kids money doesn't grow on bushes?
More information about the Comp.lang.c
mailing list