[PATCH 39/39] Compile tst-deadline.c with -Wno-ignored-attributes for Clang

Sam James sam@gentoo.org
Sun Dec 22 05:01:11 GMT 2024


"H.J. Lu" <hjl.tools@gmail.com> writes:

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

Reviewed-by: Sam James <sam@gentoo.org>


More information about the Libc-alpha mailing list