diff options
author | Joseph Myers <joseph@codesourcery.com> | 2017-08-02 16:09:01 +0000 |
---|---|---|
committer | Joseph Myers <joseph@codesourcery.com> | 2017-08-02 16:09:01 +0000 |
commit | 2fee621de0776a6e729c3b18c27442e00733f2b2 (patch) | |
tree | 177de86dc69d58d34beab8a80799ae91c26f3bfd /ChangeLog | |
parent | b358255f953943967398e19066eb266c6ea881b9 (diff) | |
download | glibc-2fee621de0776a6e729c3b18c27442e00733f2b2.tar.gz glibc-2fee621de0776a6e729c3b18c27442e00733f2b2.tar.xz glibc-2fee621de0776a6e729c3b18c27442e00733f2b2.zip |
Fix tgmath.h for bit-fields (bug 21685).
The tgmath.h macros produce errors for bit-field arguments, because they apply sizeof and typeof to the arguments. This patch fixes them to use unary + systematically before using sizeof or typeof on arguments that might be bit-fields (note that __real__ of a bit-field is still a bit-field for this purpose, since it's an lvalue). gen-tgmath-tests.py is extended to add tests for this case. Tested for x86_64. [BZ #21685] * math/tgmath.h (__tgmath_real_type): Use unary + on potentially bit-field expressions passed to sizeof or typeof. [__HAVE_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT)] (__TGMATH_F128): Likewise. [__HAVE_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT)] (__TGMATH_CF128): Likewise. (__TGMATH_UNARY_REAL_ONLY): Likewise. (__TGMATH_UNARY_REAL_RET_ONLY): Likewise. (__TGMATH_BINARY_FIRST_REAL_ONLY): Likewise. (__TGMATH_BINARY_FIRST_REAL_STD_ONLY): Likewise. (__TGMATH_BINARY_REAL_ONLY): Likewise. (__TGMATH_BINARY_REAL_STD_ONLY): Likewise. (__TGMATH_BINARY_REAL_RET_ONLY): Likewise. (__TGMATH_TERNARY_FIRST_SECOND_REAL_ONLY): Likewise. (__TGMATH_TERNARY_REAL_ONLY): Likewise. (__TGMATH_TERNARY_FIRST_REAL_RET_ONLY): Likewise. (__TGMATH_UNARY_REAL_IMAG): Likewise. (__TGMATH_UNARY_IMAG): Likewise. (__TGMATH_UNARY_REAL_IMAG_RET_REAL): Likewise. (__TGMATH_BINARY_REAL_IMAG): Likewise. * math/gen-tgmath-tests.py (Type.init_types): Create bit_field type. (define_vars_for_type): Handle bit_field type specially. (Tests.__init__): Declare structure with bit-field element.
Diffstat (limited to 'ChangeLog')
-rw-r--r-- | ChangeLog | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog index 337d37e87f..75cc492923 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,31 @@ +2017-08-02 Joseph Myers <joseph@codesourcery.com> + + [BZ #21685] + * math/tgmath.h (__tgmath_real_type): Use unary + on potentially + bit-field expressions passed to sizeof or typeof. + [__HAVE_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT)] + (__TGMATH_F128): Likewise. + [__HAVE_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT)] + (__TGMATH_CF128): Likewise. + (__TGMATH_UNARY_REAL_ONLY): Likewise. + (__TGMATH_UNARY_REAL_RET_ONLY): Likewise. + (__TGMATH_BINARY_FIRST_REAL_ONLY): Likewise. + (__TGMATH_BINARY_FIRST_REAL_STD_ONLY): Likewise. + (__TGMATH_BINARY_REAL_ONLY): Likewise. + (__TGMATH_BINARY_REAL_STD_ONLY): Likewise. + (__TGMATH_BINARY_REAL_RET_ONLY): Likewise. + (__TGMATH_TERNARY_FIRST_SECOND_REAL_ONLY): Likewise. + (__TGMATH_TERNARY_REAL_ONLY): Likewise. + (__TGMATH_TERNARY_FIRST_REAL_RET_ONLY): Likewise. + (__TGMATH_UNARY_REAL_IMAG): Likewise. + (__TGMATH_UNARY_IMAG): Likewise. + (__TGMATH_UNARY_REAL_IMAG_RET_REAL): Likewise. + (__TGMATH_BINARY_REAL_IMAG): Likewise. + * math/gen-tgmath-tests.py (Type.init_types): Create bit_field + type. + (define_vars_for_type): Handle bit_field type specially. + (Tests.__init__): Declare structure with bit-field element. + 2017-08-02 H.J. Lu <hongjiu.lu@intel.com> [BZ #21791] |