The question seems to be a classic one, but I didn't find an answer:
I have two struct type written in C ------ struct type A and struct type B, and B use A while A use B at the same time.
In a.h:
#include "b.h"
struct B;
typedef struct A {
void (*func)(struct B* b);
}A;
In b.h:
#include "a.h"
typedef struct B {
A a;
}B;
though this will work, it has a consequence --- when using the function fun "func", if I pass a variable declared in the form:
B* someb;
not:
struct B* someb;
there will be a warning when compiling, saying incompatible pointer type. Is this normal? could I avoid this warning?