Skip to content

Commit

Permalink
Makefile.uk: Fix 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.
These should be enabled only 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 Jun 20, 2023
1 parent 60ba9f5 commit 684a841
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 684a841

Please sign in to comment.