Skip to content

Commit

Permalink
Add allowed and known set of Clang warnings
Browse files Browse the repository at this point in the history
Add sets of disabled warning flags for allowed Clang warnings and known Clang warnings. These warnings may be of occasional interest, so we may want to enable to disable them separately from other flags. These flags are not part of a failure set for warnings, but may be of interest when scanning to show known warnings.

Allowed warnings are distinct from warnings that will never be of any interest, such as warning about code being incompatible with obsolete C++ standards which we don't target. Known warnings are things we might like to fix, but haven't addressed yet.
  • Loading branch information
DanRStevens committed Mar 9, 2025
1 parent 40c2429 commit 45582c9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion makefile
Original file line number Diff line number Diff line change
Expand Up @@ -212,11 +212,15 @@ $(PACKAGE_NAME): $(OUTPUT) $(shell find $(SRCDIR) -name '*.h')
## Linting ##

clangWarnNotInterested := -Wno-c++98-compat-pedantic -Wno-pre-c++17-compat
clangWarnAllowed := -Wno-padded
clangWarnKnown := -Wno-global-constructors -Wno-exit-time-destructors -Wno-unused-member-function
clangWarnShow := -Weverything $(clangWarnNotInterested)
clangWarnFlags := $(clangWarnShow) $(clangWarnAllowed) $(clangWarnKnown)

.PHONY: show-warnings
show-warnings:
@$(MAKE) clean-all > /dev/null
$(MAKE) --output-sync all CXX=clang++ CXXFLAGS_WARN="-Weverything $(clangWarnNotInterested)" 2>&1 >/dev/null | grep -o "\[-W.*\]" | sort | uniq
$(MAKE) --output-sync all CXX=clang++ CXXFLAGS_WARN="$(clangWarnShow)" 2>&1 >/dev/null | grep -o "\[-W.*\]" | sort | uniq
@$(MAKE) clean-all > /dev/null

.PHONY: lint
Expand Down

0 comments on commit 45582c9

Please sign in to comment.