On 12/2/20 11:43 AM, Martin Sebor wrote:
> The r11-5622 change to -Wformat-overflow switched the warning
> to using the maximm object size limit used by the other overflow
> and out of bounds access warnings like -Wstringop-overflow.
> That in turn exposed a subtle off-by-one mistake in the former
> that was also reflected in a few tests, seen in ILP32 but not
> in LP64.  I just committed the attached patch adjusts the tests
> to correctly reflect the limit.  These mistakes would be easier
> to avoid if if were possible to lower the max object size limit
> from PTRDIFF_MAX - 1 to a value that's independent of the target
> as in the following patch:
>
> https://gcc.gnu.org/pipermail/gcc-patches/2020-November/559450.html
>
> Martin
>
> gcc-sprintf-max-objsize.diff
>
> commit 0a7dc4b6440faa8cd57c630f1e394a719469c399
> Author: Martin Sebor <mse...@redhat.com>
> Date:   Wed Dec 2 11:29:11 2020 -0700
>
>     Adjust test to avoid ILP32 failures after r11-5622 (PR middle-end/97373)
>     
>     gcc/testsuite/ChangeLog:
>             * gcc.dg/tree-ssa/builtin-sprintf-warn-1.c: Adjust expected 
> warnings
>             to correctly reflect the maximum object size.
>             * gcc.dg/tree-ssa/builtin-sprintf-warn-11.c: Same.
>             * gcc.dg/tree-ssa/builtin-sprintf-warn-18.c: Same.
Thanks!  I'll turn the tester back on  :-)  If you don't hear from me
over the next few hours, then assume all is well again.


jeff

Reply via email to