From 6567bec2514663f8fae1252a64da23b88c65ba73 Mon Sep 17 00:00:00 2001 From: Nikos Oikonomou Date: Fri, 31 Mar 2023 19:58:16 +0300 Subject: [PATCH] Makefile.uk: Don't add unsupported warnings when built with clang Clang (12.0.0) does not recognize the warnings: no-unused-but-set-variable, no-maybe-uninitialized, no-builtin-declaration-mismatch. It would print "unknown warning option" warning messages during compilation. These should be enabled only when compiling with GCC (tested with 11.3.0). GitHub-Fixes: #1 Co-authored-by: Nikos Oikonomou Signed-off-by: Nikos Oikonomou Signed-off-by: Groute --- Makefile.uk | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Makefile.uk b/Makefile.uk index 3e10a65..82bc38e 100644 --- a/Makefile.uk +++ b/Makefile.uk @@ -71,9 +71,10 @@ CXXINCLUDES-$(CONFIG_LIBCOMPILER_RT) += -I$(LIBCOMPILER_RT_SRC)/include # Global flags ################################################################################ -LIBCOMPILER_RT_SUPPRESS_FLAGS += -Wno-unused-parameter -Wno-builtin-declaration-mismatch -LIBCOMPILER_RT_CFLAGS-y += $(LIBCOMPILER_RT_SUPPRESS_FLAGS) -LIBCOMPILER_RT_CXXFLAGS-y += $(LIBCOMPILER_RT_SUPPRESS_FLAGS) +LIBCOMPILER_RT_SUPPRESS_FLAGS-$(call have_gcc) += -Wno-unused-but-set-variable -Wno-maybe-uninitialized -Wno-builtin-declaration-mismatch +LIBCOMPILER_RT_SUPPRESS_FLAGS-y += -Wno-unused-parameter +LIBCOMPILER_RT_CFLAGS-y += $(LIBCOMPILER_RT_SUPPRESS_FLAGS-y) +LIBCOMPILER_RT_CXXFLAGS-y += $(LIBCOMPILER_RT_SUPPRESS_FLAGS-y) ################################################################################ # Library sources