Skip to content

Refine CPPLINT script to not report __CPROVER_ usage outside of strings #5000

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 9, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions scripts/cpplint.py
Original file line number Diff line number Diff line change
Expand Up @@ -4605,7 +4605,7 @@ def CheckAssert(filename, clean_lines, linenum, error):


def Check__CPROVER_(filename, clean_lines, linenum, error):
"""Check for uses of __CPROVER_.
"""Check for uses of __CPROVER_ in strings.

Args:
filename: The name of the current file.
Expand All @@ -4614,7 +4614,7 @@ def Check__CPROVER_(filename, clean_lines, linenum, error):
error: The function to call with any errors found.
"""
line = clean_lines.lines[linenum]
match = Match(r'.*__CPROVER_.*', line)
match = Match(r'.*"([^"\\]|\\.)*__CPROVER_([^"\\]|\\.)*".*', line)
if match:
error(filename, linenum, 'build/deprecated', 4,
'use CPROVER_PREFIX instead of __CPROVER_')
Expand Down