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.
This commit is contained in:
parent
83773cec9a
commit
a0ea27cccf
1 changed files with 2 additions and 2 deletions
4
.github/workflows/code_checks.yml
vendored
4
.github/workflows/code_checks.yml
vendored
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue