[clang] [Sema] -Wzero-as-null-pointer-constant: don't warn for __null (PR #69126)

Arseny Kapoulkine via cfe-commits cfe-commits at lists.llvm.org
Sun Oct 15 13:31:18 PDT 2023


zeux wrote:

Note: a limitation of this change is that we will still warn on use of `NULL` when it is defined as 0, which could be a problem for clang-cl. This could be lifted by removing the "NULL" macro name check, but unfortunately that is insufficient to detect the use of NULL inside macro expansion (such as `MCRO(NULL)` in the test file). Because of this, this change is conservative in that it aligns the logic with GCC but doesn't attempt to handle NULL fully. I can revise this if this seems like an issue worth addressing here.

This change revises the logic of https://github.com/llvm/llvm-project/commit/809df34efc653c6a471f951305a88bd5e675b522 so
cc @LebedevRI as the author of that adjustment, @nico as the original author, and @AaronBallman since this was suggested on Discord.

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


More information about the cfe-commits mailing list