delcypher wrote:

@bwendling This is unfortunate

```
drivers/gpu/drm/radeon/pptable.h:442:5: error: 'counted_by' cannot be applied 
to an array with element of unknown size because 'ATOM_PPLIB_STATE_V2' (aka 
'struct _ATOM_PPLIB_STATE_V2') is a struct type with a flexible array member
  442 |     ATOM_PPLIB_STATE_V2 states[] __counted_by(ucNumEntries);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
```

Based on our previous discussion 
(https://github.com/llvm/llvm-project/pull/90786#issuecomment-2108855275) I 
hope we can agree using the attribute this way is problematic. I don't see how 
`states` could be have its bounds correctly computed when the compiler doesn't 
know how big `struct _ATOM_PPLIB_STATE_V2` actually is.

To unbreak this particular use quickly I'll downgrade the struct with FAM case 
to a warning and from there we'll need to decide how to proceed.

https://github.com/llvm/llvm-project/pull/90786
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to