[all-commits] [llvm/llvm-project] f50d35: [clang][modules] giving the __stddef_ headers thei...

Ian Anderson via All-commits all-commits at lists.llvm.org
Wed Mar 13 11:16:02 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f50d3582b4844b86ad86372028e44b52c560ec7d
      https://github.com/llvm/llvm-project/commit/f50d3582b4844b86ad86372028e44b52c560ec7d
  Author: Ian Anderson <iana at apple.com>
  Date:   2024-03-13 (Wed, 13 Mar 2024)

  Changed paths:
    M clang/lib/Basic/Module.cpp
    M clang/lib/Headers/__stddef_null.h
    M clang/lib/Headers/__stddef_nullptr_t.h
    M clang/lib/Headers/__stddef_offsetof.h
    M clang/lib/Headers/__stddef_ptrdiff_t.h
    M clang/lib/Headers/__stddef_rsize_t.h
    M clang/lib/Headers/__stddef_size_t.h
    M clang/lib/Headers/__stddef_unreachable.h
    M clang/lib/Headers/__stddef_wchar_t.h
    M clang/lib/Headers/module.modulemap
    M clang/lib/Lex/ModuleMap.cpp
    M clang/test/Modules/no-undeclared-includes-builtins.cpp
    M clang/test/Modules/stddef.c

  Log Message:
  -----------
  [clang][modules] giving the __stddef_ headers their own modules can cause redeclaration errors with -fbuiltin-headers-in-system-modules (#84127)

On Apple platforms, some of the stddef.h types are also declared in
system headers. In particular NULL has a conflicting declaration in
<sys/_types/_null.h>. When that's in a different module from
<__stddef_null.h>, redeclaration errors can occur.

Make the \_\_stddef_ headers be non-modular in
-fbuiltin-headers-in-system-modules and restore them back to not
respecting their header guards. Still define the header guards though.
__stddef_max_align_t.h was in _Builtin_stddef_max_align_t prior to the
addition of _Builtin_stddef, and it needs to stay in a module because
struct's can't be type merged. __stddef_wint_t.h didn't used to have a
module, but leave it in it current module since it doesn't really belong
to stddef.h.



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