#include #include #include /* header */ typedef struct { char b1[4]; char b2[24]; } foo_t; extern foo_t *init(void); #if ONE /* first source file */ extern char a1[4]; extern char a2[24]; foo_t *init(void) { foo_t *foo = malloc(sizeof(foo_t)); memcpy(&(foo->b1), &a1, sizeof(a1)); memcpy(&(foo->b2), &a2, sizeof(a2)); return foo; } #else /* second source file */ #if STRICT char a1[4] = {}; char a2[24] = {}; #else int a1 = 0; struct { char x1[20]; int x2; } a2 = { }; #endif int main() { foo_t * f = init(); if (f) printf("ok\n%s",f->b2); return 0; } #endif