You can't nest typedefs. You need to do it in two steps.
And s is not an object anyway. It's just a type.
Code:
union header; // forward reference
typedef struct S {
unsigned int size;
union header *next;
} s;
typedef union header {
s q;
long padding;
} Header;
int main() {
Header header, *block_header = &header;
block_header->q.size = 1;
return 0;
}
Alternatively, you can just leave out the typedef of the inner struct since it's probably useless anyway.
Code:
typedef union header {
struct S {
unsigned int size;
union header *next;
} s; // now this is an object, not just a type
long padding;
} Header;
int main() {
Header header, *block_header = &header;
block_header->s.size = 1;
return 0;
}