void added a comment.

In D148381#4639909 <https://reviews.llvm.org/D148381#4639909>, @kees wrote:

> I can generate warnings for anonymous structs were the `__counted_by` member 
> is reported as "not found". For example:
>
>   little.c:7:28: warning: counted_by field 'count' not found
>       7 |                 int array[] __counted_by(count);
>         |                                          ^~~~~
>
> For this:
>
>   #define __counted_by(member)   __attribute__((__counted_by__(member)))
>   
>   struct anon {
>           unsigned long flags;
>           struct {
>                   unsigned char count;
>                   int array[] __counted_by(count);
>           };
>   };
>   
>   extern void bar(int input);
>   
>   void foo(struct anon *p, int index)
>   {
>           bar(p->array[index]);
>   }

I'll look into this.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D148381/new/

https://reviews.llvm.org/D148381

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to