You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
In ISO C11, it's legal and useful to define a struct like
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:
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.
The text was updated successfully, but these errors were encountered: