aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2024-12-20 05:52:56 +0800
committerH.J. Lu <hjl.tools@gmail.com>2024-12-22 17:49:22 +0800
commit39a3b5c8f66efd60c39734796e5f56b2d1d14302 (patch)
tree97660c3bd81cb0a56e747e981bb5ddf0b49ed852
parent5b9bc1a172dd15f3562a7305ee365d70e351f2de (diff)
downloadglibc-39a3b5c8f66efd60c39734796e5f56b2d1d14302.zip
glibc-39a3b5c8f66efd60c39734796e5f56b2d1d14302.tar.gz
glibc-39a3b5c8f66efd60c39734796e5f56b2d1d14302.tar.bz2
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 <hjl.tools@gmail.com> Reviewed-by: Sam James <sam@gentoo.org>
-rw-r--r--inet/Makefile4
-rw-r--r--inet/net-internal.h2
2 files changed, 5 insertions, 1 deletions
diff --git a/inet/Makefile b/inet/Makefile
index cb97b45..b12a1e4 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 f5749a8..ad71fbe 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