From GCC: ISO C90 does not support flexible array members.
and:
ISO C forbids zero-size array 'namestr'
Therefore I contest that your way is the "correct" way, especially since most C code is not C99 code. Also I'd probably never use this in C++. If you want to let subsequent programmers know you're using the variable length structure, add the comment: /* unwarranted chumminess with the compiler */
Comments
From GCC: ISO C90 does not support flexible array members. and: ISO C forbids zero-size array 'namestr'
Therefore I contest that your way is the "correct" way, especially since most C code is not C99 code. Also I'd probably never use this in C++. If you want to let subsequent programmers know you're using the variable length structure, add the comment: /* unwarranted chumminess with the compiler */