Fixed the bug that a union type containing a struct with a flexible array member was accepted as a struct member or array element type.
This commit is contained in:
@@ -1,9 +1,13 @@
|
||||
/* Bug #2017 - cc65 erroneously allows arrays of structs with flexible array members */
|
||||
|
||||
struct z {
|
||||
typedef struct x {
|
||||
int a;
|
||||
int c;
|
||||
int b[];
|
||||
};
|
||||
int b[]; /* Ok: Flexible array member can be last */
|
||||
} x;
|
||||
|
||||
struct z y[3]; /* Should be an error */
|
||||
typedef union u {
|
||||
int a;
|
||||
x x; /* Ok: Union member can contain flexible array member */
|
||||
} u;
|
||||
|
||||
union u y[3]; /* Should be an error */
|
||||
|
||||
Reference in New Issue
Block a user