On Wed, 11 Jun 2025, Qing Zhao wrote:

> When I was adding more testing cases for the pointee type being 
> structure/union, I have a question for the following case:
> 
> struct item5 {
>   int a;
>   float b[];
> };
> 
> struct pointer_array_9 {
>    ...
>   int count5;
>   struct item5 *array_5 __attribute__ ((counted_by (count5)));
> }; 
> 
> In the above, “struct item5” is a structure type with flexible array 
> member, whose size is not know during compilation time, as a result, the 
> size of the whole structure is unknown during compilation time, shall we 
> reject such cases?

Since the standard doesn't allow a structure with a flexible array member 
(or a union containing such a structure, recursively) to be an element of 
an array, it seems reasonable to reject such cases as well.

-- 
Joseph S. Myers
josmy...@redhat.com

Reply via email to