This is the mail archive of the newlib@sourceware.cygnus.com mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

bug in ctype.h


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




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]