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

David Spickett via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 19 02:21:20 PDT 2023


DavidSpickett created this revision.
Herald added a subscriber: kristof.beyls.
Herald added a project: All.
DavidSpickett requested review of this revision.
Herald added projects: LLVM, libunwind.
Herald added subscribers: libcxx-commits, llvm-commits.
Herald added a reviewer: libunwind.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D155685

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


Index: libunwind/src/UnwindLevel1-gcc-ext.c
===================================================================
--- libunwind/src/UnwindLevel1-gcc-ext.c
+++ libunwind/src/UnwindLevel1-gcc-ext.c
@@ -167,7 +167,7 @@
     }
 
     // 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;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D155685.541906.patch
Type: text/x-patch
Size: 567 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230719/37c8e19b/attachment.bin>


More information about the llvm-commits mailing list