Creating and initializing a flexible array member like that is not part of the C standard, it's a non-standard extension.
structs with flexible arrays are considered 'incomplete types' and thus can only be defined as pointers.
If you add -pedantic to gcc you'll see it warn you about it.