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>
This commit is contained in:
H.J. Lu 2024-12-20 05:52:56 +08:00
parent 5b9bc1a172
commit 39a3b5c8f6
2 changed files with 5 additions and 1 deletions

View File

@ -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 = \

View File

@ -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