diff --git a/linters/cpp_linter/cpplint.py b/linters/cpp_linter/cpplint.py index 814b44f20..5f7e169bb 100755 --- a/linters/cpp_linter/cpplint.py +++ b/linters/cpp_linter/cpplint.py @@ -1420,6 +1420,9 @@ def CheckForHeaderGuard(filename, lines, error): endif = None endif_linenum = 0 for linenum, line in enumerate(lines): + # Already been well guarded, no need for further checking. + if line.strip() == "#pragma once": + return linesplit = line.split() if len(linesplit) >= 2: # find the first occurrence of #ifndef and #define, save arg