[llvm] [NFC] Fix multi-character character constant warning (PR #112809)

via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 17 19:18:02 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-binary-utilities

Author: Jinsong Ji (jsji)

<details>
<summary>Changes</summary>

This is one of the many PRs to fix errors with LLVM_ENABLE_WERROR=on. Built by GCC 11.

Fix warning:

In file included from llvm-project/llvm/lib/BinaryFormat/Minidump.cpp:9:
llvm-project/llvm/include/llvm/BinaryFormat/Minidump.h:250:37: error: multi-character character constant [-Werror=multichar]
  250 |   static const uint32_t LLDB_FLAG = 'LLDB';


---
Full diff: https://github.com/llvm/llvm-project/pull/112809.diff


1 Files Affected:

- (modified) llvm/include/llvm/BinaryFormat/Minidump.h (+1-1) 


``````````diff
diff --git a/llvm/include/llvm/BinaryFormat/Minidump.h b/llvm/include/llvm/BinaryFormat/Minidump.h
index addff42982352f..03497d4c5fa66f 100644
--- a/llvm/include/llvm/BinaryFormat/Minidump.h
+++ b/llvm/include/llvm/BinaryFormat/Minidump.h
@@ -247,7 +247,7 @@ static_assert(sizeof(Thread) == 48);
 struct Exception {
   static constexpr size_t MaxParameters = 15;
   static constexpr size_t MaxParameterBytes = MaxParameters * sizeof(uint64_t);
-  static const uint32_t LLDB_FLAG = 'LLDB';
+  static const uint32_t LLDB_FLAG = 0x4C4C4442; // ASCII for 'LLDB'
 
   support::ulittle32_t ExceptionCode;
   support::ulittle32_t ExceptionFlags;

``````````

</details>


https://github.com/llvm/llvm-project/pull/112809


More information about the llvm-commits mailing list