From a0ea27cccfc7c2198c8a3ded7c9828fdac624c45 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 17 Apr 2023 18:30:32 +0200 Subject: [PATCH] Restrict check for obsolete macros to C++ code Only check for the use of NULL in C++ code, not C, for example, where it still can, and should, be used. Also allow using "NULL" as part of a larger macro name (where it would be followed by "_") or at the beginning/end of a string. --- .github/workflows/code_checks.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/code_checks.yml b/.github/workflows/code_checks.yml index 065271f877..d3ce8b644c 100644 --- a/.github/workflows/code_checks.yml +++ b/.github/workflows/code_checks.yml @@ -87,8 +87,8 @@ jobs: run: | git fetch --depth=1 origin master if git diff origin/master \ - ':!.github/workflows/code_checks.yml' \ - | grep -E '^\+.*(wxOVERRIDE|wxNOEXCEPT|[^_@]NULL)'; then + ':**.h' ':**.cpp' \ + | grep -E '^\+.*(wxOVERRIDE|wxNOEXCEPT|[^"_@]NULL[^"_])'; then echo "::error ::Please use C++11 equivalents of the deprecated macros in the new code." exit 1 fi