[all-commits] [llvm/llvm-project] 4ab37e: [clang][Fuchsia] Use unsigned int for wint_t on *-...

Roland McGrath via All-commits all-commits at lists.llvm.org
Thu Jun 13 23:41:20 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4ab37e430d960b975bfdaf95516a39ea3468f7a1
      https://github.com/llvm/llvm-project/commit/4ab37e430d960b975bfdaf95516a39ea3468f7a1
  Author: Roland McGrath <mcgrathr at google.com>
  Date:   2024-06-13 (Thu, 13 Jun 2024)

  Changed paths:
    M clang/lib/Basic/Targets/OSTargets.h
    M clang/test/Preprocessor/init-x86.c
    M clang/test/Preprocessor/init.c

  Log Message:
  -----------
  [clang][Fuchsia] Use unsigned int for wint_t on *-fuchsia targets (#95499)

This aligns Fuchsia targets with other similar OS targets such as
Linux.  Fuchsia's libc already uses unsigned rather than the
compiler-provided __WINT_TYPE__ macro for its wint_t typedef, so
this just makes the compiler consistent with the OS's actual ABI.
The only known manifestation of the mismatch is -Wformat warnings
for %lc no matching wint_t arguments.

The closest thing I could see to existing tests for each target's
wint_t type setting was the predefine tests that check various
macros including __WINT_TYPE__ on a per-machine and/or per-OS
basis.  While the setting is done per-OS in most of the target
implementations rather than actually varying by machine, the only
existing tests for __WINT_TYPE__ are in per-machine checks that
are also wholly or partly tagged as per-OS.  x86_64 and riscv64
tests for respective *-linux-gnu targets now check for the same
definitions in the respective *-fuchsia targets.  __WINT_TYPE__
is not among the type checked in the aarch64 tests and those lack
a section that's specifically tested for aarch64-linux-gnu; if
such is added then it can similarly be made to check for most or
all of the same value on aarch64-fuchsia as aarch64-linux-gnu.
But since the actual implementation of choosing the type is done
per-OS and not per-machine for the three machines with Fuchsia
target support, the x86 and riscv64 tests are already redundantly
testing that same code and seem sufficient.



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