G
goldfita
I have the following two prototypes in separate source files. Both
programs compile and work correctly.
(1) void general_foo(void (*foo)(), int opt, ...);
(2) static int __wait_get_general(struct ast_connection *conn, int
(*_get)(), int opt, ...);
When I compile the second source file, gcc says
ast_man.c:47: warning: function declaration isn't a prototype
There are no warnings from compiliation of the first file. I don't
understand what the problem is. Even more confusing, I don't
understand what's different. I'm guessing it has something to do with
the function pointers since all the rest of my prototypes were accepted
by the compiler. The function pointers don't declare arguments because
the number and types are unknown until runtime.
programs compile and work correctly.
(1) void general_foo(void (*foo)(), int opt, ...);
(2) static int __wait_get_general(struct ast_connection *conn, int
(*_get)(), int opt, ...);
When I compile the second source file, gcc says
ast_man.c:47: warning: function declaration isn't a prototype
There are no warnings from compiliation of the first file. I don't
understand what the problem is. Even more confusing, I don't
understand what's different. I'm guessing it has something to do with
the function pointers since all the rest of my prototypes were accepted
by the compiler. The function pointers don't declare arguments because
the number and types are unknown until runtime.