This is an archive of the discontinued LLVM Phabricator instance.

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

Authored by DavidSpickett on Jul 19 2023, 2:21 AM.

Details

Summary

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.

Diff Detail

Event Timeline

DavidSpickett created this revision.Jul 19 2023, 2:21 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 19 2023, 2:21 AM
DavidSpickett requested review of this revision.Jul 19 2023, 2:21 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJul 19 2023, 2:21 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript
michaelplatings accepted this revision.Jul 19 2023, 4:43 AM
michaelplatings added a subscriber: michaelplatings.

LGTM and fixes the issue for me. I agree there doesn't seem to be a good reason to have the const there in the first place.

MaskRay accepted this revision.Jul 19 2023, 8:37 AM
MaskRay added a subscriber: MaskRay.

Looks great!

This revision is now accepted and ready to land.Jul 19 2023, 8:37 AM
This revision was landed with ongoing or failed builds.Jul 19 2023, 9:01 AM
This revision was automatically updated to reflect the committed changes.