* Hrvoje Niksic ([EMAIL PROTECTED]) [20010306 10:35]:

> > #ifdef isalpha
> >  #error "safe-ctype.h and ctype.h may not be used simultaneously"
> > #else
> 
> Is the error statement actually true, or is this only a warning that
> tries to enforce consistency of the application?

The error statement is true. Remember that ctype.h is locale dependent
whereas safe-ctype is not. So for instance isprint (ctype.h) and ISPRINT
(safe-ctype) could well produce different results. And as the intention
is to get rid of the locale dependency, you have to block the inclusion
of ctype.h.

The caveat with using safe-ctype is, that it won't work with multibyte
encodings or wchars. So in the end every use of is... does need to be
checked anway.
 
> Also, won't this trigger an error if a system header file, say
> string.h, happens to include <ctype.h>?  (I know system header files
> should not do that because it pollutes your namespace, but older
> systems sometimes do that.)

Yes, it would trigger in that case. But safe-ctype was developed for GCC
originally and as gcc is used also on old systems (one of them the original
BSD), I guess we would have heard if safe-ctype broke things.

Philipp

-- 
Penguins shall save the dinosaurs
                          -- Handelsblatt about Linux on S/390

Reply via email to