Allow gcc warning for toupper even with extended charsets.
* libc/include/ctype.h (toupper, tolower) [_MB_EXTENDED_CHARSETS_ISO]: Allow gcc warning when called with 'char' even when we must call the function for correct behavior. [!_MB_EXTENDED_CHARSETS_ISO]: Fix regression in result type.
This commit is contained in:
parent
47b09662ee
commit
82b77480f7
@ -1,3 +1,11 @@
|
|||||||
|
2009-04-30 Eric Blake <ebb9@byu.net>
|
||||||
|
|
||||||
|
Allow gcc warning for toupper even with extended charsets.
|
||||||
|
* libc/include/ctype.h (toupper, tolower)
|
||||||
|
[_MB_EXTENDED_CHARSETS_ISO]: Allow gcc warning when called with
|
||||||
|
'char' even when we must call the function for correct behavior.
|
||||||
|
[!_MB_EXTENDED_CHARSETS_ISO]: Fix regression in result type.
|
||||||
|
|
||||||
2009-04-24 Jeff johnston <jjohnstn@redhat.com>
|
2009-04-24 Jeff johnston <jjohnstn@redhat.com>
|
||||||
|
|
||||||
* libc/stdio/fgetc.c: Make sure sfp lock is acquired before the
|
* libc/stdio/fgetc.c: Make sure sfp lock is acquired before the
|
||||||
|
@ -71,14 +71,25 @@ extern __IMPORT char *__ctype_ptr__;
|
|||||||
/* Non-gcc versions will get the library versions, and will be
|
/* Non-gcc versions will get the library versions, and will be
|
||||||
slightly slower. These macros are not NLS-aware so they are
|
slightly slower. These macros are not NLS-aware so they are
|
||||||
disabled if the system supports the extended character sets. */
|
disabled if the system supports the extended character sets. */
|
||||||
# if defined(__GNUC__) && !defined (_MB_EXTENDED_CHARSETS_ISO) && !defined (_MB_EXTENDED_CHARSETS_WINDOWS)
|
# if defined(__GNUC__)
|
||||||
# define toupper(__c) \
|
# if !defined (_MB_EXTENDED_CHARSETS_ISO) && !defined (_MB_EXTENDED_CHARSETS_WINDOWS)
|
||||||
|
# define toupper(__c) \
|
||||||
__extension__ ({ __typeof__ (__c) __x = (__c); \
|
__extension__ ({ __typeof__ (__c) __x = (__c); \
|
||||||
islower(__x) ? (__x - 'a' + 'A') : __x;})
|
islower (__x) ? (int) __x - 'a' + 'A' : (int) __x;})
|
||||||
# define tolower(__c) \
|
# define tolower(__c) \
|
||||||
__extension__ ({ __typeof__ (__c) __x = (__c); \
|
__extension__ ({ __typeof__ (__c) __x = (__c); \
|
||||||
isupper(__x) ? (__x - 'A' + 'a') : __x;})
|
isupper (__x) ? (int) __x - 'A' + 'a' : (int) __x;})
|
||||||
#endif
|
# else /* _MB_EXTENDED_CHARSETS* */
|
||||||
|
/* Allow a gcc warning if the user passed 'char', but defer to the
|
||||||
|
function. */
|
||||||
|
# define toupper(__c) \
|
||||||
|
__extension__ ({ __typeof__ (__c) __x = (__c); \
|
||||||
|
(void) __ctype_ptr__[__x]; (toupper) (__x);})
|
||||||
|
# define tolower(__c) \
|
||||||
|
__extension__ ({ __typeof__ (__c) __x = (__c); \
|
||||||
|
(void) __ctype_ptr__[__x]; (tolower) (__x);})
|
||||||
|
# endif /* _MB_EXTENDED_CHARSETS* */
|
||||||
|
# endif /* __GNUC__ */
|
||||||
#endif /* !__cplusplus */
|
#endif /* !__cplusplus */
|
||||||
|
|
||||||
#ifndef __STRICT_ANSI__
|
#ifndef __STRICT_ANSI__
|
||||||
|
Loading…
x
Reference in New Issue
Block a user