[all-commits] [llvm/llvm-project] ea2515: [LLVM][Support] Allow `char[N]` parameters in `llv...

Tomohiro Kashiwada via All-commits all-commits at lists.llvm.org
Mon Oct 13 02:10:04 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ea251536d55f493d9eb4bb18fb027709c4d39509
      https://github.com/llvm/llvm-project/commit/ea251536d55f493d9eb4bb18fb027709c4d39509
  Author: Tomohiro Kashiwada <kikairoya at gmail.com>
  Date:   2025-10-13 (Mon, 13 Oct 2025)

  Changed paths:
    M llvm/include/llvm/Support/Format.h
    M llvm/unittests/Support/CMakeLists.txt
    A llvm/unittests/Support/Format.cpp

  Log Message:
  -----------
  [LLVM][Support] Allow `char[N]` parameters in `llvm::format` (#159541)

Cygwin builds are currently broken after #157312, which effectively
reverted #138117. The root cause is that Cygwin defines
`DL_info::dli_fname` as `char[N]`, which is not a valid parameter type
for `llvm::format`.

This patch allows `llvm::format` to accept `char[N]` by decaying it to
`const char *`. As a result, string literals are also accepted without
an explicit cast.

Other array types remain rejected:
- Wide/unicode character arrays (e.g., `wchar_t[N]`) are not supported,
as LLVM does not use them and they are less compatible with platform's
`printf` implementations.
- Non-character arrays (e.g., `int[N]`) are also rejected, since passing
such arrays to `printf` is meaningless.



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