-
Notifications
You must be signed in to change notification settings - Fork 20
Open
Description
In ISO C11, it's legal and useful to define a struct like
struct {
int a;
union {
int b;
float c;
};
int d;
} foo;
in such a case, an instance foo of struct bar would have foo.b and foo.c accessing the same memory as different types. In addition, it is also legal and useful to do this:
struct foo {
int a;
};
struct bar {
struct foo;
float b;
char *c;
};
in which case, a pointer to bar can be easily and safely cast to a pointer to foo, and an instance baz of struct bar would have member baz.a as an int.
Millfork already supports both structure and union types, and I feel that this ability would make it even better.
Metadata
Metadata
Assignees
Labels
No labels