kees added a comment.

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]);
  }

Otherwise, things are looking good on test builds so far...


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