mirror of git://sourceware.org/git/glibc.git
* include/ctype.h (__ctype_b_loc, __ctype_toupper_loc,
__ctype_tolower_loc): Avoid "dereferencing type-punned pointer will break strict-aliasing rules" warnings.
This commit is contained in:
parent
98c24a32e6
commit
0d2f48bb4a
|
@ -1,3 +1,9 @@
|
||||||
|
2003-07-29 Jakub Jelinek <jakub@redhat.com>
|
||||||
|
|
||||||
|
* include/ctype.h (__ctype_b_loc, __ctype_toupper_loc,
|
||||||
|
__ctype_tolower_loc): Avoid "dereferencing type-punned pointer will
|
||||||
|
break strict-aliasing rules" warnings.
|
||||||
|
|
||||||
2003-07-29 Roland McGrath <roland@redhat.com>
|
2003-07-29 Roland McGrath <roland@redhat.com>
|
||||||
|
|
||||||
* elf/Makefile: Revert accidental changes in last commit.
|
* elf/Makefile: Revert accidental changes in last commit.
|
||||||
|
|
|
@ -25,31 +25,43 @@ __libc_tsd_define (extern, CTYPE_TOLOWER)
|
||||||
CTYPE_EXTERN_INLINE const uint16_t ** __attribute__ ((const))
|
CTYPE_EXTERN_INLINE const uint16_t ** __attribute__ ((const))
|
||||||
__ctype_b_loc (void)
|
__ctype_b_loc (void)
|
||||||
{
|
{
|
||||||
const uint16_t **tablep =
|
union
|
||||||
(const uint16_t **) __libc_tsd_address (CTYPE_B);
|
{
|
||||||
if (__builtin_expect (*tablep == NULL, 0))
|
void **ptr;
|
||||||
*tablep = (const uint16_t *) _NL_CURRENT (LC_CTYPE, _NL_CTYPE_CLASS) + 128;
|
const uint16_t **tablep;
|
||||||
return tablep;
|
} u;
|
||||||
|
u.ptr = __libc_tsd_address (CTYPE_B);
|
||||||
|
if (__builtin_expect (*u.tablep == NULL, 0))
|
||||||
|
*u.tablep = (const uint16_t *) _NL_CURRENT (LC_CTYPE, _NL_CTYPE_CLASS) + 128;
|
||||||
|
return u.tablep;
|
||||||
}
|
}
|
||||||
|
|
||||||
CTYPE_EXTERN_INLINE const int32_t ** __attribute__ ((const))
|
CTYPE_EXTERN_INLINE const int32_t ** __attribute__ ((const))
|
||||||
__ctype_toupper_loc (void)
|
__ctype_toupper_loc (void)
|
||||||
{
|
{
|
||||||
const int32_t **tablep =
|
union
|
||||||
(const int32_t **) __libc_tsd_address (CTYPE_TOUPPER);
|
{
|
||||||
if (__builtin_expect (*tablep == NULL, 0))
|
void **ptr;
|
||||||
*tablep = ((int32_t *) _NL_CURRENT (LC_CTYPE, _NL_CTYPE_TOUPPER) + 128);
|
const int32_t **tablep;
|
||||||
return tablep;
|
} u;
|
||||||
|
u.ptr = __libc_tsd_address (CTYPE_TOUPPER);
|
||||||
|
if (__builtin_expect (*u.tablep == NULL, 0))
|
||||||
|
*u.tablep = ((int32_t *) _NL_CURRENT (LC_CTYPE, _NL_CTYPE_TOUPPER) + 128);
|
||||||
|
return u.tablep;
|
||||||
}
|
}
|
||||||
|
|
||||||
CTYPE_EXTERN_INLINE const int32_t ** __attribute__ ((const))
|
CTYPE_EXTERN_INLINE const int32_t ** __attribute__ ((const))
|
||||||
__ctype_tolower_loc (void)
|
__ctype_tolower_loc (void)
|
||||||
{
|
{
|
||||||
const int32_t **tablep =
|
union
|
||||||
(const int32_t **) __libc_tsd_address (CTYPE_TOLOWER);
|
{
|
||||||
if (__builtin_expect (*tablep == NULL, 0))
|
void **ptr;
|
||||||
*tablep = ((int32_t *) _NL_CURRENT (LC_CTYPE, _NL_CTYPE_TOLOWER) + 128);
|
const int32_t **tablep;
|
||||||
return tablep;
|
} u;
|
||||||
|
u.ptr = __libc_tsd_address (CTYPE_TOLOWER);
|
||||||
|
if (__builtin_expect (*u.tablep == NULL, 0))
|
||||||
|
*u.tablep = ((int32_t *) _NL_CURRENT (LC_CTYPE, _NL_CTYPE_TOLOWER) + 128);
|
||||||
|
return u.tablep;
|
||||||
}
|
}
|
||||||
|
|
||||||
# endif /* Not NOT_IN_libc. */
|
# endif /* Not NOT_IN_libc. */
|
||||||
|
|
Loading…
Reference in New Issue