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

Florian Weimer fweimer@redhat.com
Mon May 11 15:41:10 GMT 2020


* Martin Sebor:

> On 5/8/20 10:04 AM, Florian Weimer wrote:
>> * 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.
>
> Sounds good.  I will commit the attached patch unless there are more
> suggestions for changes.

Thanks, this patch looks good to me.

Florian



More information about the Libc-alpha mailing list