[all-commits] [llvm/llvm-project] d50483: [gsymutil] Fix a warning on systems with 32-bit `o...

Justin Bogner via All-commits all-commits at lists.llvm.org
Fri Apr 10 09:19:58 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d5048392b9a73b22ba9758789812ef22c75271fb
      https://github.com/llvm/llvm-project/commit/d5048392b9a73b22ba9758789812ef22c75271fb
  Author: Justin Bogner <mail at justinbogner.com>
  Date:   2026-04-10 (Fri, 10 Apr 2026)

  Changed paths:
    M llvm/lib/DebugInfo/GSYM/FileWriter.cpp
    M llvm/lib/DebugInfo/GSYM/GsymCreator.cpp

  Log Message:
  -----------
  [gsymutil] Fix a warning on systems with 32-bit `off_t` (#189524)

The size of `off_t` isn't specified, so it can be either 32 or 64 bits
depending on the system. In particular, on LLP64 systems like windows
it's generally only 32 bits. This means the `if (StrtabSize >
UINT32_MAX)` check added in #181458 may warn on such systems (Giving
-Wsign-compare).

Given that `FileWriter::tell` (and the underlying `raw_ostream::tell`)
explicitly return `uint64_t`, the simplest fix is to just use the return
type of the function instead of potentially truncating. Since the same
logic applies even where we don't happen to have a warning here, I've
applied this for all of these uses of `off_t`.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list