|
|
|
|
|
by milesrout
3353 days ago
|
|
Not really that dangerous, except for all the code for which it is dangerous? Of course, you've got me, it only breaks existing code, and doesn't affect code that's written perfectly according to the rules of C and not peoples' intuitions about what pointers actually mean on a hardware level. It's not even safe to do this: struct a {
int x;
};
struct b {
int x;
int y;
};
struct b b;
struct a *a = &b;
You have to write b like this: struct b {
struct a inner;
int y;
};
|
|