[PATCH] avoid GCC 10 test suite warnings (BZ #25219)

Florian Weimer fweimer@redhat.com
Fri May 8 16:04:54 GMT 2020


* Martin Sebor via Libc-alpha:

> +
> +#if __GNUC_PREREQ (7, 0)
> +  DIAG_PUSH_NEEDS_COMMENT;
> +  /* Avoid warnings about the second (size) argument being excessive.  */
> +  DIAG_IGNORE_NEEDS_COMMENT (10.1, "-Wstringop-overflow");
> +#endif
>    fails |= test_wrp (EINVAL, readlink, "/", buf, -1);
> +#if __GNUC_PREREQ (7, 0)
> +  DIAG_POP_NEEDS_COMMENT;
> +#endif

I'd suggest to use

    fails |= test_wrp (EINVAL, readlink, "/", buf, sizeof (buf));

here, for the reason you explained.

Thanks,
Florian



More information about the Libc-alpha mailing list