* Cast to uintptr_t in MIPS jmpbuf-unwind.h
@ 2012-11-21 16:43 Joseph S. Myers
0 siblings, 0 replies; only message in thread
From: Joseph S. Myers @ 2012-11-21 16:43 UTC (permalink / raw)
To: libc-ports
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2012-11-21 16:43 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-21 16:43 Cast to uintptr_t in MIPS jmpbuf-unwind.h Joseph S. Myers
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).