[llvm] [GSYM] Silence cast warning (PR #191561)

via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 10 15:53:57 PDT 2026


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-debuginfo

Author: Alexandre Ganea (aganea)

<details>
<summary>Changes</summary>

Previously this was generating "warning: comparison of integers of different signs".

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


1 Files Affected:

- (modified) llvm/lib/DebugInfo/GSYM/GsymCreator.cpp (+1-1) 


``````````diff
diff --git a/llvm/lib/DebugInfo/GSYM/GsymCreator.cpp b/llvm/lib/DebugInfo/GSYM/GsymCreator.cpp
index f26e69fda2540..60ac162e33822 100644
--- a/llvm/lib/DebugInfo/GSYM/GsymCreator.cpp
+++ b/llvm/lib/DebugInfo/GSYM/GsymCreator.cpp
@@ -171,7 +171,7 @@ llvm::Error GsymCreator::encode(FileWriter &O) const {
 
   // Verify that the size of the string table does not exceed 32-bit max.
   // This means the offsets in the string table will not exceed 32-bit max.
-  if (StrtabSize > UINT32_MAX) {
+  if (static_cast<uint64_t>(StrtabSize) > UINT32_MAX) {
     return createStringError(std::errc::invalid_argument,
                              "string table size exceeded 32-bit max");
   }

``````````

</details>


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


More information about the llvm-commits mailing list