[libunwind] a96d4c1 - [libunwind] Fix build error on 32 bit Arm after -Wcast-qual was added

David Spickett via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 19 09:01:49 PDT 2023


Author: David Spickett
Date: 2023-07-19T16:01:42Z
New Revision: a96d4c1ed62fd187c21acf82b43072444ffb2084

URL: https://github.com/llvm/llvm-project/commit/a96d4c1ed62fd187c21acf82b43072444ffb2084
DIFF: https://github.com/llvm/llvm-project/commit/a96d4c1ed62fd187c21acf82b43072444ffb2084.diff

LOG: [libunwind] Fix build error on 32 bit Arm after -Wcast-qual was added

New warning was added in https://reviews.llvm.org/D153911 which caused:
https://buildkite.com/llvm-project/libcxx-ci/builds/28407#01896b79-2a5e-4554-ac31-2abec5a8b281

../../libunwind/src/UnwindLevel1-gcc-ext.c:172:47: error: cast from 'const unsigned int *' to 'unsigned int *' drops const qualifier [-Werror,-Wcast-qual]
    ex.pr_cache.ehtp = (_Unwind_EHT_Header *) unwindInfo;

I don't see any reason there should be a const here in the first place,
so just remove it.

Reviewed By: #libunwind, michaelplatings, MaskRay

Differential Revision: https://reviews.llvm.org/D155685

Added: 
    

Modified: 
    libunwind/src/UnwindLevel1-gcc-ext.c

Removed: 
    


################################################################################
diff  --git a/libunwind/src/UnwindLevel1-gcc-ext.c b/libunwind/src/UnwindLevel1-gcc-ext.c
index efb872bbe59eb2..d343f4e6e9cc83 100644
--- a/libunwind/src/UnwindLevel1-gcc-ext.c
+++ b/libunwind/src/UnwindLevel1-gcc-ext.c
@@ -167,7 +167,7 @@ _Unwind_Backtrace(_Unwind_Trace_Fn callback, void *ref) {
     }
 
     // Update the pr_cache in the mock exception object.
-    const uint32_t* unwindInfo = (uint32_t *) frameInfo.unwind_info;
+    uint32_t *unwindInfo = (uint32_t *)frameInfo.unwind_info;
     ex.pr_cache.fnstart = frameInfo.start_ip;
     ex.pr_cache.ehtp = (_Unwind_EHT_Header *) unwindInfo;
     ex.pr_cache.additional= frameInfo.flags;


        


More information about the cfe-commits mailing list