]> xenbits.xensource.com Git - unikraft/libs/musl.git/commitdiff
Makefile.uk: Fix gcc specific warnings
authorMiguel Rodrigues <migb.rodrigues@gmail.com>
Thu, 11 May 2023 13:18:14 +0000 (14:18 +0100)
committerUnikraft <monkey@unikraft.io>
Wed, 7 Jun 2023 12:10:49 +0000 (12:10 +0000)
-Wno-restrict, Wno-unused-but-set-variable, -Wno-maybe-unitialized and
-Wno-format-contains-nul are gcc-specific flags, so include them only when
compiling with gcc and not with clang.

Signed-off-by: Miguel Rodrigues <migb.rodrigues@gmail.com>
Reviewed-by: Stefan Jumarea <stefanjumarea02@gmail.com>
Reviewed-by: Eduard Vintilă <eduard.vintila47@gmail.com>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #51

Makefile.uk

index 0f3437a8b7176dffb966c76bdcddb9ef6e2a4544..b08740339eda463b34e6695c14dc88b0b4e87b73 100644 (file)
@@ -131,15 +131,15 @@ LIBMUSL_HDRS_FLAGS-y += -Wno-error=sign-compare
 LIBMUSL_HDRS_FLAGS-y += -Wno-builtin-macro-redefined
 
 LIBMUSL_CFLAGS-y += -Wno-implicit-fallthrough
-LIBMUSL_CFLAGS-y += -Wno-restrict
-LIBMUSL_CFLAGS-y += -Wno-unused-but-set-variable
+LIBMUSL_CFLAGS-$(call have_gcc) += -Wno-restrict
+LIBMUSL_CFLAGS-$(call have_gcc) += -Wno-unused-but-set-variable
 LIBMUSL_CFLAGS-y += -Wno-sign-compare
 LIBMUSL_CFLAGS-y += -Wno-empty-body
-LIBMUSL_CFLAGS-y += -Wno-maybe-uninitialized
+LIBMUSL_CFLAGS-$(call have_gcc) += -Wno-maybe-uninitialized
 LIBMUSL_CFLAGS-y += -Wno-unknown-pragmas
 LIBMUSL_CFLAGS-y += -Wno-missing-braces
 LIBMUSL_CFLAGS-$(call gcc_version_ge,8,0) += -Wno-cast-function-type
-LIBMUSL_CFLAGS-y += -Wno-format-contains-nul
+LIBMUSL_CFLAGS-$(call have_gcc) += -Wno-format-contains-nul
 LIBMUSL_CFLAGS-y += -Wno-type-limits
 LIBMUSL_CFLAGS-y += -DUK_LIBC_SYSCALLS=0
 LIBMUSL_CFLAGS-y += -D_XOPEN_SOURCE=700