bug in ctype.h
Serge Nikulin
nikulin@actsw.amat.com
Fri May 12 13:56:00 GMT 2000
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
More information about the Newlib
mailing list