On 10/14/20 2:09 PM, Martin Sebor via Gcc-patches wrote:
> The attribute access implicitly added to function declarations
> with VLA parameters includes the top-level VLA bounds chained
> together similarly to other attribute arguments.  However,
> since attribute access is limited to at most 3 arguments
> including the mode, a function that takes three or more VLA
> arguments triggers an error from decl_attributes complaining
> about excess arguments.
>
> The attached patch gets around it by wrapping the VLA bound
> chain in a list.  It doesn't feel like the most elegant solution
> but it's simple and  I couldn't think of anything better.  If no
> one comes up with a suggestion for a better way of dealing with
> this I'll commit the fix sometime tomorrow as obvious.
>
> Martin
>
>
> gcc-97413.diff
>
> PR c/97413 - bogus error on function declaration with many VLA arguments
>
> gcc/ChangeLog:
>
>       PR c/97413
>       * attribs.c (init_attr_rdwr_indices): Unwrap extra list layer.
>
> gcc/c-family/ChangeLog:
>
>       PR c/97413
>       * c-attribs.c (build_attr_access_from_parms): Wrap chain of VLA
>       bounds in an extra list.
>
> gcc/testsuite/ChangeLog:
>
>       PR c/97413
>       * gcc.dg/Wvla-parameter-8.c: New test.

So as I mentioned in IRC, at the time you posted this I had just
extracted a testcase from a package build failure.  Your timing was
impeccable to get my immediate attention :-)


OK.


jeff

Reply via email to