Skip to content

Commit

Permalink
Makefile.uk: Don't add unsupported warnings when built with clang
Browse files Browse the repository at this point in the history
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: unikraft#1

Co-authored-by: Nikos Oikonomou <[email protected]>
Signed-off-by: Nikos Oikonomou <[email protected]>
Signed-off-by: Groute <[email protected]>
  • Loading branch information
ntua-el20014 authored and iAmGroute committed May 10, 2023
1 parent 60ba9f5 commit 6567bec
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Makefile.uk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6567bec

Please sign in to comment.