A
Alex Vinokur
How does typedef work for foo2_t?
What can one do with foo2_t?
------ bar.c ------
void foo() {}
typedef void (*foo1_t)();
typedef void foo2_t(); /* How does typedef work here? */
int main()
{
foo1_t foo1 = foo;
foo2_t foo2 = foo; /* Line 9 */
return 0;
}
-------------------
GNU gcc 4.0.1
bar.c: In function `main':
bar.c:9: error: function `foo2' is initialized like a variable
What can one do with foo2_t?
------ bar.c ------
void foo() {}
typedef void (*foo1_t)();
typedef void foo2_t(); /* How does typedef work here? */
int main()
{
foo1_t foo1 = foo;
foo2_t foo2 = foo; /* Line 9 */
return 0;
}
-------------------
GNU gcc 4.0.1
bar.c: In function `main':
bar.c:9: error: function `foo2' is initialized like a variable