On 11/07/2023 15:54, Richard Earnshaw (lists) via Gcc-patches wrote:
On 11/07/2023 10:37, Florian Weimer via Gcc-patches wrote:
libgcc/
* config/aarch64/aarch64-unwind.h (aarch64_cie_signed_with_b_key):
Add missing const qualifier. Cast from const unsigned char *
to const char *. Use __builtin_strchr to avoid an implicit
function declaration.
* config/aarch64/linux-unwind.h (aarch64_fallback_frame_state):
Add missing cast.
---
diff --git a/libgcc/config/aarch64/linux-unwind.h
b/libgcc/config/aarch64/linux-unwind.h
index 00eba866049..93da7a9537d 100644
--- a/libgcc/config/aarch64/linux-unwind.h
+++ b/libgcc/config/aarch64/linux-unwind.h
@@ -77,7 +77,7 @@ aarch64_fallback_frame_state (struct _Unwind_Context
*context,
}
rt_ = context->cfa;
- sc = &rt_->uc.uc_mcontext;
+ sc = (struct sigcontext *) &rt_->uc.uc_mcontext;
/* This define duplicates the definition in aarch64.md */
#define SP_REGNUM 31
This looks somewhat dubious. I'm not particularly familiar with the
kernel headers, but a quick look suggests an mcontext_t is nothing like
a sigcontext_t. So isn't the cast just papering over some more
fundamental problem?
R.
Sorry, I was looking at the wrong set of headers. It looks like these
have to match. But in that case, I think we should have a comment about
that here to explain the suspicious cast.
R.