This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug math/21685] tgmath.h handling of bit-fields
- From: "cvs-commit at gcc dot gnu.org" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Wed, 02 Aug 2017 16:09:56 +0000
- Subject: [Bug math/21685] tgmath.h handling of bit-fields
- Auto-submitted: auto-generated
- References: <bug-21685-131@http.sourceware.org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=21685
--- Comment #1 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".
The branch, master has been updated
via 2fee621de0776a6e729c3b18c27442e00733f2b2 (commit)
from b358255f953943967398e19066eb266c6ea881b9 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=2fee621de0776a6e729c3b18c27442e00733f2b2
commit 2fee621de0776a6e729c3b18c27442e00733f2b2
Author: Joseph Myers <joseph@codesourcery.com>
Date: Wed Aug 2 16:09:01 2017 +0000
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.
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 28 +++++++++++
math/gen-tgmath-tests.py | 12 ++++-
math/tgmath.h | 118 +++++++++++++++++++++++-----------------------
3 files changed, 98 insertions(+), 60 deletions(-)
--
You are receiving this mail because:
You are on the CC list for the bug.