From 303bb42c5244518204015d0e7b69d93fb2a70723 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Sun, 18 Oct 2020 14:21:25 -0700 Subject: [PATCH] Makefile: allow disabling compiler warnings Move the user-specified CFLAGS to the end of the CFLAGS definition, so that warnings the Makefile enables can be disabled using -Wno-$foo. This is useful when old compilers give false positive warnings. --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 35b2367..3c09edc 100644 --- a/Makefile +++ b/Makefile @@ -45,14 +45,14 @@ cc-option = $(shell if $(CC) $(1) -c -x c /dev/null -o /dev/null \ 1>&2 2>/dev/null; then echo $(1); fi) override CFLAGS := \ - -O2 -fomit-frame-pointer $(CFLAGS) -std=c99 -I. \ - -Wall -Wundef \ + -O2 -fomit-frame-pointer -std=c99 -I. -Wall -Wundef \ $(call cc-option,-Wpedantic) \ $(call cc-option,-Wdeclaration-after-statement) \ $(call cc-option,-Wmissing-prototypes) \ $(call cc-option,-Wstrict-prototypes) \ $(call cc-option,-Wvla) \ - $(call cc-option,-Wimplicit-fallthrough) + $(call cc-option,-Wimplicit-fallthrough) \ + $(CFLAGS) FREESTANDING := ifdef FREESTANDING