This is the mail archive of the
newlib@sourceware.cygnus.com
mailing list for the newlib project.
bug in ctype.h
- To: <newlib at sourceware dot cygnus dot com>
- Subject: bug in ctype.h
- From: "Serge Nikulin" <nikulin at actsw dot amat dot com>
- Date: Fri, 12 May 2000 13:55:10 -0700
ctype.h contains improper declaration of tolower/toupper pseudofuncs.
It can be demonstrated with:
gcc -Werror -pedantic-errors -Wreturn-type -Wswitch -Wuninitialized -Wparent
heses -Wall
gcc reports "ANSI C++ forbids braced-groups within expressions"
My change for these definitions:
#ifdef __GNUC__
# define toupper(c) (islower((c)) ? ((c) - 'a' + 'A') : (c))
# define tolower(c) (isupper((c)) ? ((c) - 'A' + 'a') : (c))
#endif