On Thu, 15 Jun 2023, Qing Zhao via Gcc-patches wrote: > B. The argument of the new attribute “counted_by” is an identifier that can be > accepted by “c_parser_attribute_arguments”: > > struct trailing_array_B { > Int count; > int array_B[] __attribute ((counted_by (count))); > }; > > > From my current very limited understanding of the C FE source code, it’s > not easy to extend the argument to an expression later for the above. Is > this understanding right? It wouldn't be entirely compatible: if you change to interpreting the argument as an expression, then the above would suggest a global variable count is used (as opposed to some other syntax for referring to an element of the containing structure). So an attribute that takes an element name might best be a *different* attribute from any potential future one taking an expression (with some new syntax to refer to an element). -- Joseph S. Myers joseph@codesourcery.com