From f7112f626f305e8a8e1fee2c72acf9058ed6830a Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Tue, 25 Oct 2022 16:41:54 -1000 Subject: [PATCH] makefile: Make gcc and clang warnings fail builds on compile warnings This change allows CI builds to fail without detailed viewing of build output for gcc and clang builds (all modern compilers). Thus forcing PR submitters to find these problems before PRs are merged. This is done by compiling with -Werror for these compilers. We don't know how to do this for other compilers which may be able to use the makefile, so warnings there will still proceed to build successfully. --- makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/makefile b/makefile index 1e986a68..5930f74f 100644 --- a/makefile +++ b/makefile @@ -309,6 +309,7 @@ ifeq (${WIN32},) #*nix Environments (&& cygwin) endif endif else + OS_CCDEFS += -Werror ifeq (,$(findstring ++,${GCC})) CC_STD = -std=gnu99 else @@ -316,6 +317,7 @@ ifeq (${WIN32},) #*nix Environments (&& cygwin) endif endif else + OS_CCDEFS += -Werror ifeq (Apple,$(shell ${GCC} -v /dev/null 2>&1 | grep 'Apple' | awk '{ print $$1 }')) COMPILER_NAME = $(shell ${GCC} -v /dev/null 2>&1 | grep 'Apple' | awk '{ print $$1 " " $$2 " " $$3 " " $$4 }') CLANG_VERSION = $(word 4,$(COMPILER_NAME))