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

Jinsong Ji via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 17 19:17:25 PDT 2024


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

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';


>From 39226faa2088a3fea7d760531441f5457d9833e4 Mon Sep 17 00:00:00 2001
From: Jinsong Ji <jinsong.ji at intel.com>
Date: Fri, 18 Oct 2024 04:14:51 +0200
Subject: [PATCH] [NFC] Fix multi-character character constant warning

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';
---
 llvm/include/llvm/BinaryFormat/Minidump.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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;



More information about the llvm-commits mailing list