bwendling wrote:
> Strictly speaking, I don't think this is NFC. Consider, for example:
>
> ```
> struct S {
> struct X { int array[1]; } x;
> struct Y { int count; int array[] __attribute__((__counted_by__(count))); }
> y;
> };
> void f(void* __attribute__((pass_dynamic_object_size(0;
efriedma-quic wrote:
Strictly speaking, I don't think this is NFC. Consider, for example:
```
struct S {
struct X { int array[1]; } x;
struct Y { int count; int array[] __attribute__((__counted_by__(count))); } y;
};
void f(void* __attribute__((pass_dynamic_object_size(0;
void g(struct
bwendling wrote:
> Does this still work for cases where there are multiple flexible arrays? e.g.
>
> ```
> struct weird_protocol {
> unsigned int cmd_type;
> unsigned int data_len;
> union {
> struct cmd_one one[];
> struct cmd_two two[];
> struct cmd_three th
kees wrote:
Does this still work for cases where there are multiple flexible arrays? e.g.
```
struct weird_protocol {
unsigned int cmd_type;
unsigned int data_len;
union {
struct cmd_one one[];
struct cmd_two two[];
struct cmd_three three[];
unsigned c
llvmbot wrote:
@llvm/pr-subscribers-clang
@llvm/pr-subscribers-clang-codegen
Author: Bill Wendling (bwendling)
Changes
Testing for the name of the flexible array member isn't as robust as testing
the FieldDecl pointers.
---
Full diff: https://github.com/llvm/llvm-project/pull/89462.diff
https://github.com/bwendling created
https://github.com/llvm/llvm-project/pull/89462
Testing for the name of the flexible array member isn't as robust as testing
the FieldDecl pointers.
>From 2a6b3356a977132459bed84fb4e4add631e181cb Mon Sep 17 00:00:00 2001
From: Bill Wendling
Date: Fri, 19 A