[PATCH] wrap long tree chains in a list to avoid attribute error (PR 97413)

Martin Sebor msebor@gmail.com
Wed Oct 14 20:09:54 GMT 2020


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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: gcc-97413.diff
Type: text/x-patch
Size: 5187 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20201014/7cba8a19/attachment.bin>


More information about the Gcc-patches mailing list