Studio 12.6 C compiler asserts on the when trying to assign a field of anonymous struct inside anonymous union:
struct s {
int i1, i2;
union {
void* v;
struct {
int i3;
};
};
};
void x(struct s* s)
{
s->i3 = 3;
}
cc -std=c11 -c union.c:
Assertion failed: offset >= 0 && offset < record->size, file ../src/ctypes.c, line 456
cc: Warning: Static error checker encountered an unexpected error.
Interesting part is, after removing field 'i2' from struct s this code compiles fine