From 39a3b5c8f66efd60c39734796e5f56b2d1d14302 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Fri, 20 Dec 2024 05:52:56 +0800 Subject: [PATCH] Compile tst-deadline.c with -Wno-ignored-attributes for Clang Since tst-deadline.c is an internal test, compile tst-deadline.c with -Wno-ignored-attributes for Clang to silence -Werror,-Wunknown-attributes errors. Also suppress -Wmaybe-uninitialized only for GCC in net-internal.h. Signed-off-by: H.J. Lu Reviewed-by: Sam James --- inet/Makefile | 4 ++++ inet/net-internal.h | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/inet/Makefile b/inet/Makefile index cb97b45f0f..b12a1e4228 100644 --- a/inet/Makefile +++ b/inet/Makefile @@ -139,6 +139,10 @@ ifeq ($(build-static-nss),yes) CFLAGS += -DSTATIC_NSS endif +ifeq ($(have-test-clang),yes) +CFLAGS-tst-deadline.c += -Wno-ignored-attributes +endif + # The test uses dlopen indirectly and would otherwise load system # objects. tst-idna_name_classify-ENV = \ diff --git a/inet/net-internal.h b/inet/net-internal.h index f5749a8662..ad71fbecf0 100644 --- a/inet/net-internal.h +++ b/inet/net-internal.h @@ -106,7 +106,7 @@ __deadline_is_infinite (struct deadline deadline) * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91691 */ DIAG_PUSH_NEEDS_COMMENT; -DIAG_IGNORE_NEEDS_COMMENT (9, "-Wmaybe-uninitialized"); +DIAG_IGNORE_NEEDS_COMMENT_GCC (9, "-Wmaybe-uninitialized"); /* Return true if the current time is at the deadline or past it. */ static inline bool