I am just wondering how typedef
is not throwing any compilation error when its used with undeclared structure. Below code is compiling without any warning and error. My doubt is how come a typedef
with undeclared structure is not throwing any error. Is it same in all platforms
#include <stdio.h>
typedef struct undeclared_struct_st UND_STRUCT_S;
int main()
{
printf("\nhello world\n");
return 0;
}
I am executing this program in Suse 11 with gcc 4.3.4.