This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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.
diff --git a/sysdeps/s390/jmpbuf-unwind.h b/sysdeps/s390/jmpbuf-unwind.h
index b7b6b9d..cb33aee 100644
--- a/sysdeps/s390/jmpbuf-unwind.h
+++ b/sysdeps/s390/jmpbuf-unwind.h
@@ -32,10 +32,10 @@
 
 /* On s390{,x}, CFA is always 96 (resp. 160) bytes above actual
    %r15.  */
-#define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
-  _JMPBUF_UNWINDS_ADJ (_jmpbuf,					\
-		       (void *) (_Unwind_GetCFA (_context)	\
-				 - 32 - 2 * __WORDSIZE), _adj)
+#define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj)		\
+  _JMPBUF_UNWINDS_ADJ (_jmpbuf,						\
+		       (void *) (_Unwind_Ptr) (_Unwind_GetCFA (_context) \
+					       - 32 - 2 * __WORDSIZE), _adj)
 
 static inline uintptr_t __attribute__ ((unused))
 _jmpbuf_sp (__jmp_buf regs)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]