This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch: ctype.h replacement
>>>>> "Philipp" == Philipp Thomas <pthomas@suse.de> writes:
> * Jason Merrill (jason@redhat.com) [20001129 14:45]:
>> Why did you decide to redefine the standard ctype macros rather than
>> the capitalized versions used in GCC? The latter seems clearer to
>> me, so that I know I'm dealing with a tweaked version rather than the
>> standard library functionality.
> Remember that in order to support translated messages we will have to do
> setlocale(LC_ALL, "") which changes the behaviour of the ctype.h macros
> and some other functions from libc. The effect is in many places *not*
> what we want/need.
> To fix this, you have (at least :) two choices:
> 1) Define capitalized versions and then review every place in GCC that
> uses the lowercase versions.
The only place in gcc/ that uses the lowercase versions is doschk.c,
which is not actually part of GCC.
> 2) Redefine the standard ctype versions and rename the places where
> the capitalized versions where used.
> I'd think the latter is a lot easier then the former.
I disagree, for the above reason.
>>>>> "Zack" == Zack Weinberg <zackw@Stanford.EDU> writes:
> Assuming that we never want the C library's ctype macros, it seemed
> safer to me to replace them than rely on our capitalized versions
> being used everywhere.
It should be simple enough to avoid #including <ctype.h> if we want to
make sure we don't use the C library versions; your #ifdef from your
current patch should do it.
Jason