I have a file main.c
, which contains the following line of code:
struct args packed;
the struct args
is defined in another file named dct.c
. However that file is not included. They are passed to the compiler as gcc -Wall main.c dct.c ...
Shouldn't the compiler emit a warning about an incomplete type?
Note that struct args
is being instantiated and its members are accessed within main.c
.
I only noticed this because of the linter
warning me about an incomplete type, however GCC
seems fine with it.
What am I missing? Because as I suspected, and according to this answer they are indeed different translation units and GCC can't see the definition in the second file.