Hi
I see many posts regarding struct with variable size array.
I consider this article, written by Gnu C authors, enlightening on the topic:
Extracts:
- declaring zero-length arrays is allowed in GNU C as an extension
-
in ISO C90
the
array would typically be declared
to have a single element
- ISO C99 introduces flexible array member : the array is declared without a size, just []
In my code, for struct with a last variable size element, I use:
#if (__STDC_VERSION__ >= 199901L) // C99
char szError[];
#else
char szError[1]; // C90
#endif
Does Lua 5.3 / 5.4 support also pre C90 compilers ?
Is there any list about these compilers ?
It is useful to know which platform/compiler we loose using C90 features.
M