[clang] Ensure proper NULL macro definition for system include files. (PR #149176)

Eli Friedman via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 17 11:23:17 PDT 2025


efriedma-quic wrote:

> are you saying that you have a strong preference to not handle locale.h (for example) for non-AIX environments? 

Yes.

You know exactly which AIX headers define NULL, and because IBM also ships the AIX headers, you can ensure no future version of the headers changes the status quo.  But there are a lot of different libc variants, and I don't want to try to chase after every variant, and figure out exactly which headers define NULL, or how we accidentally broke something.  Messing with core libc headers is fundamentally risky.

Most libcs don't make the mistake of defining null to plain "0" on 64-bit systems, anyway.

-------------------

One more issue: do we need to update module.modulemap to mark these headers as "textual"?

https://github.com/llvm/llvm-project/pull/149176


More information about the cfe-commits mailing list