> On Nov 18, 2025, at 17:38, Joseph Myers <[email protected]> wrote: > > On Tue, 18 Nov 2025, Qing Zhao wrote: > >> At the same time, shall we support the following with -fms-extensions: >> >> /* -fms-extensions */ >> >> struct ids >> { >> int length_ad; >> int length_na; >> }; >> >> struct person >> { >> int age; >> int weight; >> struct ids; // Anonymous structure, no name needed >> char *address __attribute__ ((counted_by (length_ad))); >> char name[] __attribute__ ((counted_by (length_na))); >> } *Jim; >> >> i.e, in the above, the counted_by fields for Pointer “address” and FAM >> “name” are in the anonymous >> structure “struct ids” which is not inlined into the “struct person”. >> >> Any idea on this?
Thanks. I will include this. Qing > I think this would make sense and should not be difficult. > > Martin > > Yes, supporting such outward-to-inward counted_by references makes sense > in a way that inward-to-outward references don't (because checking the > validity of outward-to-inward references doesn't depend on anything > unknown at the end of the structure definition). > > -- > Joseph S. Myers > [email protected]
