[C PATCH] -Wstringop-overflow for parameters with forward-declared sizes

Joseph Myers joseph@codesourcery.com
Fri May 26 20:13:17 GMT 2023


On Fri, 26 May 2023, Martin Uecker via Gcc-patches wrote:

>     c: -Wstringop-overflow for parameters with forward-declared sizes
>     
>     Warnings from -Wstringop-overflow do not appear for parameters declared
>     as VLAs when the bound refers to a parameter forward declaration. This
>     is fixed by splitting the loop that passes through parameters into two,
>     first only recording the positions of all possible size expressions
>     and then processing the parameters.
>     
>     PR c/109970
>     
>     gcc/c-family:
>     
>             * c-attribs.cc (build_attr_access_from_parms): Split loop to first
>             record all parameters.
>     
>     gcc/testsuite:
>     
>             * gcc.dg/pr109970.c: New test.
> 

OK.

-- 
Joseph S. Myers
joseph@codesourcery.com


More information about the Gcc-patches mailing list