This is the mail archive of the
libc-ports@sources.redhat.com
mailing list for the libc-ports project.
Cast to uintptr_t in MIPS jmpbuf-unwind.h
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: <libc-ports at sourceware dot org>
- Date: Wed, 21 Nov 2012 16:43:19 +0000
- Subject: Cast to uintptr_t in MIPS jmpbuf-unwind.h
For MIPS o32, there are "initialization makes integer from pointer
without a cast" warnings from jmpbuf-unwind.h, because the __sp field
of jmp_buf has pointer type and is being stored in a uintptr_t
variable. I've applied this patch to fix this with an explicit cast
to uintptr_t.
2012-11-21 Joseph Myers <joseph@codesourcery.com>
* sysdeps/mips/jmpbuf-unwind.h (_jmpbuf_sp): Cast regs[0].__sp to
uintptr_t.
diff --git a/ports/sysdeps/mips/jmpbuf-unwind.h b/ports/sysdeps/mips/jmpbuf-unwind.h
index ba174d6..355ca56 100644
--- a/ports/sysdeps/mips/jmpbuf-unwind.h
+++ b/ports/sysdeps/mips/jmpbuf-unwind.h
@@ -33,7 +33,7 @@
static inline uintptr_t __attribute__ ((unused))
_jmpbuf_sp (__jmp_buf regs)
{
- uintptr_t sp = regs[0].__sp;
+ uintptr_t sp = (uintptr_t) regs[0].__sp;
#ifdef PTR_DEMANGLE
PTR_DEMANGLE (sp);
#endif
--
Joseph S. Myers
joseph@codesourcery.com