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?


> Suppose we can the implementation of check to do this in safe-ctype.h:
> 
> #define isalpha do_not_use_isalpha_with_safe_ctype
> etc.

After thinking about it for a little while, I think that this is the
approach that works best.

It might actually improve the check: Right now, there is a hole if ctype.h
is included after safe-ctype.h.  With the new suggested approach, if
ctype.h is included after, we should get a warning because of the is...
macros being redefined (are warnings fatal when building GCC? They are
when building GDB).  If ctype.h is included before, we should get a
compilation error because do_not_use_..._with_safe_ctype is undefined.

2008-07-02  Joel Brobecker  <brobecker@adacore.com>

        * safe-ctype.h: Remove #error when detecting that ctype.h has been
        included. Redefine the various macros provided by ctype.h as
        undefined variables.

Tested by building GDB on mips-irix (fixes the build problem there),
and on x86-linux.

OK to apply?

Thanks,
-- 
Joel

Attachment: safe-ctype.diff
Description: Text document


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