On Thu, 11 Dec 2025, Qing Zhao wrote:

> >> 3. Do you think that the above testing case is enough for this purpose?
> > 
> > Maybe also test function *definitions*
> 
> I cannot come up with such valid testing cases about function *definitions*, 
> could you please help on this?

struct { int c; char *d __attribute__ ((counted_by (c))); } *f () { return 0; }

(and likewise for the case where the member named in counted_by is 
missing, of course).

> > and definitions of typedef names.
> 
> Such as:
> 
> typedef struct {
>   int c;
>   char *d __attribute__ ((counted_by (c)));
> } mys;
> 
> typedef struct {
>   char *d1 __attribute__ ((counted_by (c1)));
> } mys1;
> 
> ??

Yes.

-- 
Joseph S. Myers
[email protected]

Reply via email to