|
From: | grischka |
Subject: | Re: [Tinycc-devel] pointers to static functions inside a static table |
Date: | Thu, 19 May 2011 12:21:14 +0200 |
User-agent: | Thunderbird 2.0.0.24 (Windows/20100228) |
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
[Prev in Thread] | Current Thread | [Next in Thread] |