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

Jez Ng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 2 05:35:17 PDT 2022


int3 accepted this revision.
int3 added inline comments.
This revision is now accepted and ready to land.


================
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),
+                "");
----------------
mstorsjo wrote:
> 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.
Gotcha. Thanks!


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