From 139408f86753e63ed06e6687ea9cd64cf1e94f6f Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sat, 7 Sep 1996 17:50:05 +0000 Subject: [PATCH] Add comments re ctype IS* macros. --- src/system.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/system.h b/src/system.h index 19df3d4..873bf78 100644 --- a/src/system.h +++ b/src/system.h @@ -300,6 +300,25 @@ char *alloca (); #include +/* Jim Meyering writes: + + "... Some ctype macros are valid only for character codes that + isascii says are ASCII (SGI's IRIX-4.0.5 is one such system --when + using /bin/cc or gcc but without giving an ansi option). So, all + ctype uses should be through macros like ISPRINT... If + STDC_HEADERS is defined, then autoconf has verified that the ctype + macros don't need to be guarded with references to isascii. ... + Defining isascii to 1 should let any compiler worth its salt + eliminate the && through constant folding." + + Bruno Haible adds: + + "... Furthermore, isupper(c) etc. have an undefined result if c is + outside the range -1 <= c <= 255. One is tempted to write isupper(c) + with c being of type `char', but this is wrong if c is an 8-bit + character >= 128 which gets sign-extended to a negative value. + The macro ISUPPER protects against this as well." */ + #if defined (STDC_HEADERS) || (!defined (isascii) && !defined (HAVE_ISASCII)) #define IN_CTYPE_DOMAIN(c) 1 #else -- 2.7.4