Hello all,
I have defined the following function type and structure.
Code:
typedef int (*t_epoll_callback)(struct epoll_server *, int, void *);
typedef void (*cb_epoll_timeout)(struct epoll_server *);
struct epoll_server {
int socket;
int epoll_fd;
struct epoll_event event;
struct epoll_event *events;
t_epoll_callback secure;
t_epoll_callback callback;
cb_epoll_timeout timeoutfunction;
int timeout;
};
When this compiles I get a complaint:
Code:
warning: ‘struct epoll_server’ declared inside parameter list
warning: ‘struct epoll_server’ declared inside parameter list
I think this is also causing me to get odd warnings when I pass a function as parameter with this type.
Code:
warning: passing argument 2 of ‘new_ip_epoll_server’ from incompatible pointer type
note: expected ‘t_epoll_callback’ but argument is of type ‘int (*)(struct epoll_server *, int, void *)’
So one way to fix it would be to just use a (void *) instead of my (struct epoll_server *) maybe?