This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: PATCH: Cast to int32 first when casting pointer to int64
On Wed, Nov 21, 2012 at 3:13 PM, Joseph S. Myers
<joseph@codesourcery.com> wrote:
> On Wed, 21 Nov 2012, H.J. Lu wrote:
>
>> +/* The real type for T, where P is 1 if T is a pointer. */
>> +#define __real_type_sub(T, P) \
>> + __typeof__ (*(0 ? (__typeof__ (0 ? (T *) 0 : (void *) (P))) 0 \
>> + : (__typeof__ (0 ? (__intptr_t *) 0 : (void *) (!(P)))) 0))
>> +
>> +/* The real type for EXPR. */
>> +#define __real_type(expr) \
>> + __real_type_sub(__typeof__ ((__typeof__ (expr)) 0), \
>> + __pointer_type (__typeof__ (expr)))
>
> Referring to "real type" is hardly appropriate here; the point in tgmath.h
> is distinguishing real and complex types and referring to the standard
> rules for how tgmath.h determines a common real type. I think you mean
> something like "intptr_t if P is true, or T if P is false" and then
> "intptr_t if EXPR has a pointer type, or the type of EXPR otherwise".
How about __integer_type with the updated comments?
> I don't think you need the x86_64 changes (I haven't seen such warnings
The x86_64 changes is for x32, which has exactly the same issue.
> there). I'd have expected a smaller local patch in i386/tls.h, not
> changing common code at all.
>
I need it for both ia32 and x32.
Thanks.
--
H.J.