Skip to content

Commit

Permalink
Ensure that warnings are filtered for GCC and Clang as appropriate
Browse files Browse the repository at this point in the history
  • Loading branch information
aaaaaa123456789 committed Jan 15, 2022
1 parent 90e24db commit 764f77f
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 @@ -5,10 +5,14 @@ OPTFLAGS = -march=native -mtune=native
CFLAGS = -std=c17 -Ofast -fomit-frame-pointer -fno-asynchronous-unwind-tables -fno-exceptions -Wl,-S -Wl,-x -Wl,--gc-sections $(OPTFLAGS)

DEBUGFLAGS = -Wall -Wextra -pedantic -Wnull-dereference -Wshadow -Wundef -Wunused -Wwrite-strings -Wno-sign-compare -Wno-implicit-fallthrough \
-Wno-parentheses -Wno-dangling-else -Wno-keyword-macro
-Wno-parentheses -Wno-dangling-else

ifneq (,$(findstring gcc,$(CC)))
DEBUGFLAGS += -Wduplicated-branches -Wduplicated-cond -Wlogical-op -Wshift-overflow=2 -fanalyzer -fanalyzer-verbosity=0
else
ifneq (,$(findstring clang, $(CC)))
DEBUGFLAGS += -Wno-keyword-macro
endif
endif

.PHONY: all clean basefiles debug
Expand Down

0 comments on commit 764f77f

Please sign in to comment.