mirror of
https://github.com/cc65/cc65.git
synced 2024-11-12 07:07:19 +00:00
32 lines
622 B
C
32 lines
622 B
C
/* Bug #2016 and #2017 - flexible array members */
|
|
|
|
typedef struct {
|
|
int a;
|
|
int b[]; /* Ok: Flexible array member can be last */
|
|
} X;
|
|
|
|
typedef union {
|
|
X x; /* Ok: Contains flexible array member */
|
|
int a;
|
|
} U;
|
|
|
|
typedef struct {
|
|
struct {
|
|
int a;
|
|
};
|
|
int b[]; /* Ok: Flexible array member can be last */
|
|
} Y;
|
|
|
|
X x;
|
|
U u;
|
|
Y y;
|
|
|
|
_Static_assert(sizeof x == sizeof (int), "sizeof x != sizeof (int)");
|
|
_Static_assert(sizeof u == sizeof (int), "sizeof u != sizeof (int)");
|
|
_Static_assert(sizeof y == sizeof (int), "sizeof y != sizeof (int)");
|
|
|
|
int main(void)
|
|
{
|
|
return 0;
|
|
}
|