This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA/RFC] Remove check of ctype.h include in safe-ctype.h?


From: "Ian Lance Taylor" <iant@google.com>

Joel Brobecker <brobecker@adacore.com> writes:

I'm not sure we should be #including <safe-ctype.h> in gcc/system.h.
It seems to me that we should include it in the relatively few files
which need it.

A quick grep of all macros defined in safe-ctype.h inside the gcc subdirectory gives a rather long list :-(: 78 files (see [1]).

If I include the rest of the tree in the search, we have to add
22 more files (see [2]).

I don't mind making the change, but is this desired?

That is more than I expected. Still, I don't mind if you make this change. The Darwin build problem does have to be fixed one way or another.

I'd be interested in hearing other comments.
Ian


Would it work to instead #poison isalpha et al in gcc/system.h? Then remove the check from safe-ctype.h altogether. (Oh I think there are several system.h files (like one in libcpp, etc). We'd need to do the poison in all of them (but not in tsystem.h). Then merely including both ctype.h and safe-ctype.h isn't an error, it's when you *use* the lowercase versions that the conflict is caught. I don't know if this solves the darwin problem or not. Also, this has the disadvantage in that users of safe-ctype.h other than GCC will not have the check.

--Kaveh


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]