Skip to content

Commit

Permalink
[libunwind] Fix build error on 32 bit Arm after -Wcast-qual was added
Browse files Browse the repository at this point in the history
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
  • Loading branch information
DavidSpickett committed Jul 19, 2023
1 parent 703bf4c commit a96d4c1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libunwind/src/UnwindLevel1-gcc-ext.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a96d4c1

Please sign in to comment.