This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] s390: Fix build warning with gcc6 in jmpbuf-unwind.h.
- From: "Carlos O'Donell" <carlos at redhat dot com>
- To: Andreas Schwab <schwab at suse dot de>, Stefan Liebler <stli at linux dot vnet dot ibm dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Thu, 23 Jul 2015 14:20:50 -0400
- Subject: Re: [PATCH] s390: Fix build warning with gcc6 in jmpbuf-unwind.h.
- Authentication-results: sourceware.org; auth=none
- References: <moq7up$vgf$1 at ger dot gmane dot org> <mvmoaj39syo dot fsf at hawking dot suse dot de> <moqas2$eb9$1 at ger dot gmane dot org> <mvmd1zj9r21 dot fsf at hawking dot suse dot de>
On 07/23/2015 05:11 AM, Andreas Schwab wrote:
> Stefan Liebler <stli@linux.vnet.ibm.com> writes:
>
>> On 07/23/2015 10:30 AM, Andreas Schwab wrote:
>>> Stefan Liebler <stli@linux.vnet.ibm.com> writes:
>>>
>>>> This patch casts _Unwind_GetCFA return to _Unwind_Ptr first
>>>
>>> How can a cast fix a truncated pointer value on s390x?
>>>
>>> Andreas.
>>>
>> Why is the pointer truncated on s390x?
>> All three types _Unwind_Word, _Unwind_Ptr and void * have a size of 4bytes
>> on s390 and 8 bytes on s390x.
>
> Then why do you get a warning?
Agreed.
Why do you get a warning if the types are, as you claim, the same size?
I don't disagree that they are the same size, since the code is generic
and `typedef unsigned _Unwind_Word __attribute__((__mode__(__word__)));`
should result in the values you quote.
If it's a compiler defect then rather than a cast you need to file a bug
and disable the warning with the glibc diagnostic macros and include
rationale for that points at the gcc bug.
Cheers,
Carlos.