[PATCH] s390: Fix build warning with gcc6 in jmpbuf-unwind.h.

Stefan Liebler stli@linux.vnet.ibm.com
Thu Jul 23 08:17:00 GMT 2015


Hi,

I get the following warning while building glibc on s390-32 with gcc 6:
In file included from unwind.c:26:0:
unwind.c: In function 'unwind_stop':
../sysdeps/s390/jmpbuf-unwind.h:37:10: error: cast to pointer from 
integer of different size [-Werror=int-to-pointer-cast]
           (void *) (_Unwind_GetCFA  (_context) \
           ^
../sysdeps/s390/jmpbuf-unwind.h:51:17: note: in definition of macro 
'_JMPBUF_UNWINDS_ADJ'
    ((uintptr_t) (_address) - (_adj) < _jmpbuf_sp (_jmpbuf) - (_adj))
                  ^
unwind.c:62:12: note: in expansion of macro '_JMPBUF_CFA_UNWINDS_ADJ'
        || ! _JMPBUF_CFA_UNWINDS_ADJ (buf->cancel_jmp_buf[0].jmp_buf, 
context,

_Unwind_GetCFA returns an _Unwind_Word which is an unsigned
with a size of 4 bytes on s390-32 and 8 bytes on s390-64.
This patch casts _Unwind_GetCFA return to _Unwind_Ptr first
and afterwards to a void pointer as it is done in nptl/unwind.c:72, too.
This removes the int-to-pointer-cast warning.

Ok for 2.22 or later?

Bye
Stefan

---
2015-07-23  Stefan Liebler  <stli@linux.vnet.ibm.com>

	* sysdeps/s390/jmpbuf-unwind.h (_JMPBUF_CFA_UNWINDS_ADJ):
	Cast return of _Unwind_GetCFA to _Unwind_Ptr first.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 20150723_jmpbuf-unwind.patch
Type: text/x-patch
Size: 744 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20150723/0b56b4b1/attachment.bin>


More information about the Libc-alpha mailing list