Jay Foad wrote:
static struct s {
void (*elem)();
} t[] = {
{ func } /* tcc requires these braces! */
};
A bit late for a correct answer but in fact these parenthesis *are* needed.
There is one set of parenthesis for the array initialization and then one for
the structure. Gcc with -Wall gives a warning now (since version 4.6).
The braces aren't required by C standards. That's why GCC *only* gives
a warning, not an error.
Jay.
Indeed tcc's parsing for initializers of (nested) structures/unions
is notoriously hackish and incomplete.
--- grischka
_______________________________________________
Tinycc-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel