[PATCH] D130970: [LLD] [MachO] Fix GCC build warnings

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 2 05:32:22 PDT 2022


mstorsjo added inline comments.


================
Comment at: lld/MachO/UnwindInfoSection.cpp:404-409
+  static_assert(static_cast<uint32_t>(UNWIND_X86_64_MODE_MASK) ==
+                    static_cast<uint32_t>(UNWIND_X86_MODE_MASK),
+                "");
+  static_assert(static_cast<uint32_t>(UNWIND_X86_64_MODE_STACK_IND) ==
+                    static_cast<uint32_t>(UNWIND_X86_MODE_STACK_IND),
+                "");
----------------
int3 wrote:
> Could we declare the enum to have size `uint32_t` instead? Or does GCC still warn in that case?
GCC still warns about that - it's not so much about whether the enums have a defined size or not, but simply that they're values from two different enums - comparing them in most cases would be a bug, while we strictly care only about their numerical value here.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D130970/new/

https://reviews.llvm.org/D130970



More information about the llvm-commits mailing list