This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: PATCH: Cast to _Unwind_Exception_Class when setting exc.exception_class
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: Roland McGrath <roland at hack dot frob dot com>, GNU C Library<libc-alpha at sourceware dot org>
- Date: Wed, 21 Nov 2012 17:27:16 +0000
- Subject: Re: PATCH: Cast to _Unwind_Exception_Class when setting exc.exception_class
- References: <CAMe9rOpaKE6XxgAev0wzivpSJoL_7-P9VycXnxyankniRZ-FPA@mail.gmail.com><20120918211231.6186A2C0A8@topped-with-meat.com><CAMe9rOp10=Y5u9BhJ6fqTmjYu_roxcXjHcdyUZ=W4XK2wfn71Q@mail.gmail.com><CAMe9rOq064vXtahyYp=UGeRkpwaSQXt14incxerQGJ0C98vcEg@mail.gmail.com><20120918220157.572E12C0AA@topped-with-meat.com><CAMe9rOrRHC4Tbe1hoCjrkYHhbL+AkTr=urK1RzEDv7FU9roLug@mail.gmail.com><Pine.LNX.4.64.1211211710200.16302@digraph.polyomino.org.uk><CAMe9rOo4Zcms4r625ujmOOfq964wQzB_rN1UG7ZPJ=Jpmgmwog@mail.gmail.com>
On Wed, 21 Nov 2012, H.J. Lu wrote:
> > I'm seeing large numbers of "cast from pointer to integer of different
> > size" warnings on x86 builds, around uses of these macros. I suspect this
> > patch is responsible - if code, even in part of an "if" statement that
> > won't be executed, contains a pointer-to-integer cast, you need to cast to
> > a pointer of the same size as the integer, and possibly then from there to
> > a type of the desired final width.
> >
>
> This is a known bug in GCC and there is no workaround.
It's not at all clear it's a bug, and it should certainly be possible to
work around it using the same sort of trick as in
tgmath.h:__tgmath_real_type_sub to create a typedef that is uint64_t when
the argument is 64-bit and uint32_t otherwise.
--
Joseph S. Myers
joseph@codesourcery.com