Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
12 changes: 10 additions & 2 deletions analyzer/codechecker_analyzer/analyzers/gcc/analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,19 @@ def get_analyzer_checkers(cls):
try:
output = subprocess.check_output(command, env=environ)

context = analyzer_context.get_context()

blacklisted_checkers = context.checker_labels.checkers_by_labels(
["blacklist:true"], cls.ANALYZER_NAME)

# Still contains the help message we need to remove.
for entry in output.decode().split('\n'):
warning_name, _, description = entry.strip().partition(' ')
# GCC Static Analyzer names start with -Wanalyzer.
if warning_name.startswith('-Wanalyzer'):
# Skip blacklisted warnings, warnings with equal signs in their name and the generic -W flag.
if '=' in warning_name or warning_name == '-W' or warning_name in blacklisted_checkers:
continue
# GCC Static Analyzer names and warning names start with -W.
if warning_name.startswith('-W'):
# Rename the checkers interally (similarly to how we
# support cppcheck)
renamed_checker_name = \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,11 @@


def actual_name_to_codechecker_name(actual_name: str):
assert actual_name.startswith('-Wanalyzer')
return actual_name.replace("-Wanalyzer", "gcc")
assert actual_name.startswith('-W')
if actual_name.startswith('-Wanalyzer'):
return actual_name.replace("-Wanalyzer", "gcc")
else:
return actual_name.replace("-W", "gcc-diagnostic-")


def codechecker_name_to_actual_name(codechecker_name: str):
Expand Down
Loading
Loading