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

Jamie Schmeiser via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 17 11:55:41 PDT 2025


jamieschmeiser 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"?

I had proposed this universally as a "public service" due to it being mandated by the C standard.  Since you are opposed, I will alter the files involved to be guarded as Aix specific.  Regarding module.modulemap, since this will now be Aix specific, we will deal with that aspect at some future point.

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


More information about the cfe-commits mailing list