PATCH: Cast _Unwind_GetCFA return to _Unwind_Ptr first in _JMPBUF_CFA_UNWINDS_ADJ

H.J. Lu hongjiu.lu@intel.com
Fri Mar 16 18:02:00 GMT 2012


On Fri, Mar 16, 2012 at 10:50:58AM -0700, H.J. Lu wrote:
> _Unwind_GetCFA returns _Unwind_Word which may be 64bit on targets with
> 32bit pointers, like x32.  This patch casts _Unwind_GetCFA return to
> _Unwind_Ptr first to silence GCC warning.  OK to install?
> 

Here is another instance to cast _Unwind_GetCFA return to _Unwind_Ptr
first.  OK to install?

Thanks.


H.J.
---
2012-03-16  H.J. Lu  <hongjiu.lu@intel.com>
 
	* sysdeps/x86_64/jmpbuf-unwind.h (_JMPBUF_CFA_UNWINDS_ADJ): Cast
	_Unwind_GetCFA return to _Unwind_Ptr first.

diff --git a/sysdeps/x86_64/jmpbuf-unwind.h b/sysdeps/x86_64/jmpbuf-unwind.h
index 646615d..890037e 100644
--- a/sysdeps/x86_64/jmpbuf-unwind.h
+++ b/sysdeps/x86_64/jmpbuf-unwind.h
@@ -28,7 +28,9 @@
   ((void *) (address) < (void *) demangle ((jmpbuf)[JB_RSP]))
 
 #define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \
-  _JMPBUF_UNWINDS_ADJ (_jmpbuf, (void *) _Unwind_GetCFA (_context), _adj)
+  _JMPBUF_UNWINDS_ADJ (_jmpbuf, \
+		       (void *) (_Unwind_Ptr) _Unwind_GetCFA (_context), \
+		       _adj)
 
 static inline uintptr_t __attribute__ ((unused))
 _jmpbuf_sp (__jmp_buf regs)
-- 
1.7.6.5



More information about the Libc-alpha mailing list