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

Ian Anderson via All-commits all-commits at lists.llvm.org
Fri Jul 26 00:21:10 PDT 2024


  Branch: refs/heads/release/19.x
  Home:   https://github.com/llvm/llvm-project
  Commit: 3120547296c558634261ec944d7846be56eba306
      https://github.com/llvm/llvm-project/commit/3120547296c558634261ec944d7846be56eba306
  Author: Ian Anderson <iana at apple.com>
  Date:   2024-07-26 (Fri, 26 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.

(cherry picked from commit 92a9d4831d5e40c286247c30fcd794563adbef6e)



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