[PATCH] D38954: [Sema] -Wzero-as-null-pointer-constant: don't warn for system macros other than NULL.

Nicolas Lesser via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 23 09:29:40 PDT 2017


Rakete1111 added inline comments.


================
Comment at: lib/Sema/Sema.cpp:445
+  // If it is a macro from system header, and if the macro name is not "NULL",
+  // do not warn.
+  SourceLocation MaybeMacroLoc = E->getLocStart();
----------------
That comment doesn't really add anything IMO. It just says what the code just below says.


================
Comment at: lib/Sema/Sema.cpp:447
+  SourceLocation MaybeMacroLoc = E->getLocStart();
+  if (SourceMgr.isInSystemMacro(E->getLocStart()) &&
+      !findMacroSpelling(MaybeMacroLoc, "NULL"))
----------------
Please use `MaybeMacroLoc` there too.


Repository:
  rL LLVM

https://reviews.llvm.org/D38954





More information about the cfe-commits mailing list