I had two files with following:
Code:
#include <stdio.h>
#include <stdlib.h>
struct point {int x; int y; int z;};
extern struct point p2;
int main()
{
struct point p1 = {0, 0, 0};
p1.x = p2.x;
printf("%d", p1.x);
return 0;
}
and:
Code:
struct point {int x; int y;};
struct point p2 = {99, 99};
So I would have thought translation units and files would have been equivalent in this case, i.e. two translation units with conflicting definitions. I had pretty much exactly the same thing in C++ too. Compilation and linking worked OK in both cases.