[PATCH] set range for strlen(array) to avoid spurious -Wstringop-overflow (PR 83373 , PR 78450)

Martin Sebor msebor@gmail.com
Wed Dec 13 16:16:00 GMT 2017


On 12/13/2017 12:25 AM, Bernhard Reutner-Fischer wrote:
> On 12 December 2017 21:15:25 CET, Martin Sebor <msebor@gmail.com> wrote:
>
>>
>> Tested on x86_64-linux.
>
> I assume this test worked even before this patch.

Of the tests added by the patch, strlenopt-37.c passes without
the compiler changes and strlenopt-36.c fails.  Both are expected.
-37.c verifies the optimization doesn't happen when it shouldn't
happen and -36.c verifies it does take place when it's safe.

The regression test for the warning fails without the patch and
passes with the patch applied.

> Thus:
>
> s/oveflow/overflow/

Thanks.  I'll fix that if/when the patch is approved.

Martin

>
> thanks,
>



More information about the Gcc-patches mailing list