[compiler-rt] [compiler-rt]: fix CodeQL format-string warnings via explicit casts (PR #153843)

Hans Wennborg via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 22 03:52:14 PDT 2025


zmodem wrote:

We're seeing build failures along the lines of

```
FAILED: compiler-rt/lib/hwasan/CMakeFiles/RTHwasan.x86_64.dir/hwasan_thread.cpp.obj 
 /b/s/w/ir/cache/builder/src/third_party/llvm-build/Release+Asserts/./bin/clang++ --target=x86_64-unknown-fuchsia --sysroot=/b/s/w/ir/cache/builder/src/third_party/fuchsia-sdk/sdk/arch/x64/sysroot -DHWASAN_REPLACE_OPERATORS_NEW_AND_DELETE=1 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/b/s/w/ir/cache/builder/src/third_party/llvm/compiler-rt/lib/hwasan/.. -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -ffunction-sections -fdata-sections -Wall -Wno-unused-parameter -O3 -DNDEBUG -std=c++17 -fPIC -fno-builtin -fno-exceptions -fomit-frame-pointer -funwind-tables -fno-stack-protector -fno-sanitize=safe-stack -fvisibility=hidden -fno-lto -Wthread-safety -Wthread-safety-reference -Wthread-safety-beta -O3 -gline-tables-only -Wno-gnu -Wno-variadic-macros -Wno-c99-extensions -ftrivial-auto-var-init=pattern -nostdinc++ -fno-rtti -ffreestanding -Wno-format -MD -MT compiler-rt/lib/hwasan/CMakeFiles/RTHwasan.x86_64.dir/hwasan_thread.cpp.obj -MF compiler-rt/lib/hwasan/CMakeFiles/RTHwasan.x86_64.dir/hwasan_thread.cpp.obj.d -o compiler-rt/lib/hwasan/CMakeFiles/RTHwasan.x86_64.dir/hwasan_thread.cpp.obj -c /b/s/w/ir/cache/builder/src/third_party/llvm/compiler-rt/lib/hwasan/hwasan_thread.cpp
 /b/s/w/ir/cache/builder/src/third_party/llvm/compiler-rt/lib/hwasan/hwasan_thread.cpp:177:11: error: unknown type name 'ssize_t'; did you mean 'size_t'?
   177 |          (ssize_t)unique_id_, (void *)this, (void *)stack_bottom(),
       |           ^~~~~~~
       |           size_t
 /b/s/w/ir/cache/builder/src/third_party/llvm-build/Release+Asserts/lib/clang/22/include/__stddef_size_t.h:18:23: note: 'size_t' declared here
    18 | typedef __SIZE_TYPE__ size_t;
       |                       ^
 1 error generated.
```

(See https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket/8705847666885606433/+/u/package_clang/stdout)

I'll back it out.

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


More information about the llvm-commits mailing list