[all-commits] [llvm/llvm-project] 92a9d4: [clang][headers] Including stddef.h always redefin...

Ian Anderson via All-commits all-commits at lists.llvm.org
Tue Jul 23 13:03:21 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 92a9d4831d5e40c286247c30fcd794563adbef6e
      https://github.com/llvm/llvm-project/commit/92a9d4831d5e40c286247c30fcd794563adbef6e
  Author: Ian Anderson <iana at apple.com>
  Date:   2024-07-23 (Tue, 23 Jul 2024)

  Changed paths:
    M clang/lib/Headers/stdarg.h
    M clang/lib/Headers/stddef.h
    M clang/test/Headers/stddefneeds.cpp
    A clang/test/Modules/stddef.cpp

  Log Message:
  -----------
  [clang][headers] Including stddef.h always redefines NULL (#99727)

stddef.h always includes __stddef_null.h. This is fine in modules
because it's not possible to re-include the pcm, and it's necessary to
export the _Builtin_stddef.null submodule. However, without modules it
causes NULL to always get redefined which disrupts some C++ code. Rework
the inclusion of __stddef_null.h so that with not building with modules
it's only included if __need_NULL is set by the includer, or it's the
first time stddef.h is being included.



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