[v3,01/11] aarch64: Avoid -Wincompatible-pointer-types warning in Linux unwinder

Message ID 6a18b92d17c1b465ebf6b4d6f94ee9050c49feac.1700473918.git.fweimer@redhat.com
State Accepted
Headers
Series : More warnings as errors by default |

Checks

Context Check Description
snail/gcc-patch-check success Github commit url

Commit Message

Florian Weimer Nov. 20, 2023, 9:55 a.m. UTC
  * config/aarch64/linux-unwind.h
	(aarch64_fallback_frame_state): Add cast to the expected type
	in sc assignment.
---
 libgcc/config/aarch64/linux-unwind.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
  

Patch

diff --git a/libgcc/config/aarch64/linux-unwind.h b/libgcc/config/aarch64/linux-unwind.h
index 00eba866049..18b3df71e7b 100644
--- a/libgcc/config/aarch64/linux-unwind.h
+++ b/libgcc/config/aarch64/linux-unwind.h
@@ -77,7 +77,10 @@  aarch64_fallback_frame_state (struct _Unwind_Context *context,
     }
 
   rt_ = context->cfa;
-  sc = &rt_->uc.uc_mcontext;
+  /* Historically, the uc_mcontext member was of type struct sigcontext, but
+     glibc uses a different type now with member names in the implementation
+     namespace.  */
+  sc = (struct sigcontext *) &rt_->uc.uc_mcontext;
 
 /* This define duplicates the definition in aarch64.md */
 #define SP_REGNUM 31