[all-commits] [llvm/llvm-project] d6bbe2: [libc] Fix definition of `UINT_MAX` in limits.h (#...

Joseph Huber via All-commits all-commits at lists.llvm.org
Wed Jun 12 13:29:31 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d6bbe2e20ff21cc2d31106742dfe1711ae5c641e
      https://github.com/llvm/llvm-project/commit/d6bbe2e20ff21cc2d31106742dfe1711ae5c641e
  Author: Joseph Huber <huberjn at outlook.com>
  Date:   2024-06-12 (Wed, 12 Jun 2024)

  Changed paths:
    M libc/include/llvm-libc-macros/limits-macros.h

  Log Message:
  -----------
  [libc] Fix definition of `UINT_MAX` in limits.h (#95279)

Summary:
Currently we use `(~0U)` for this definition, however the ~ operator
returns a different sign, meaning that preprocessor checks against this
value will fail. See https://godbolt.org/z/TrjaY1d8q where the
preprocessor thinks that it's not `0xffffffff` while the static
assertion thinks it is. This is because the latter does implicit
conversion but the preprocessor does not. This is now consistent with
other headers.



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