From b286f6b5a376c2785ad8a51120998f749cc6b585 Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Fri, 5 Nov 2021 11:44:47 -0700 Subject: [PATCH] Only use -Wno-unused if we're actually using gcc This is a bit difficult to detect, so for now we conservatively say that macOS always uses clang, and clang-based compilers always are called "clang". --- Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ea416be4..1fd63805 100644 --- a/Makefile +++ b/Makefile @@ -49,7 +49,10 @@ OBJECTS=$(AST_OBJECTS) $(COMPILER_OBJECTS) $(ANALYSIS_OBJECTS) $(VM_OBJECTS) $(T CXXFLAGS=-g -Wall -Werror LDFLAGS= -CXXFLAGS+=-Wno-unused # temporary, for older gcc versions +# temporary, for older gcc versions as they treat var in `if (type var = val)` as unused +ifeq ($(findstring g++,$(shell $(CXX) --version)),g++) +CXXFLAGS+=-Wno-unused +endif # configuration-specific flags ifeq ($(config),release)