summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1996-09-07 17:50:05 +0000
committerJim Meyering <jim@meyering.net>1996-09-07 17:50:05 +0000
commit139408f86753e63ed06e6687ea9cd64cf1e94f6f (patch)
tree0b21e5ceb7fed12e6d31d626ef5551b88b701578 /src
parentd2c6e7cba9eac5f54e9538de70ef8779d6446006 (diff)
downloadcoreutils-139408f86753e63ed06e6687ea9cd64cf1e94f6f.tar.xz
Add comments re ctype IS* macros.
Diffstat (limited to 'src')
-rw-r--r--src/system.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/system.h b/src/system.h
index 19df3d46f..873bf78ad 100644
--- a/src/system.h
+++ b/src/system.h
@@ -300,6 +300,25 @@ char *alloca ();
#include <ctype.h>
+/* 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