The following is a legal fragment in C:
/* Example 1. */
struct B *p; /* p: pointer to incomplete struct type B */
/* This declaration completes the struct type B. */
struct B {
int foo;
};
As long as no pointer operations are performed on p (e.g. p++) until complete type information for struct type B is provided, the fragment is legal C.
On the other hand, the next fragment is illegal in C:
/* Example 2. */
T_t *p; /* p: pointer to undeclared type T_t. */
typedef int T_t;
Question: What is the reason that it is legal in C to declare a pointer to an incomplete struct type and provide the complete struct type information later (Example 1), whereas it is illegal to declare a pointer to an undeclared type and declare the type later (Example 2)?