I had a typo in my code referring to a struct member which does not
belong to the struct being used, but that name exists in a different
struct. Compiler did produce .o file, - I would think this is a big
nistake, not a warning level problem.
See example below:
$ cat c.c
typedef struct {
int a;
} N1;
typedef struct {
int a;
int b;
} N2;
main(int argc, char *argv[])
{
N1 n1;
N2 n2;
n1.a = 1;
n1.b = 1;
n2.a = 1;
n2.b = 1;
}
$ cc -c c.c
UX:i386acomp: WARNING: "c.c", line 13: warning: improper member use: b
GNU compiler worked correctly:
$ gcc -c c.c
c.c: In function `main':
c.c:13: structure has no member named `b'
and no .o file created.
So, question is, does anybody know if there is a setting or flag for
the compiler to NOT produce .o file for the bug described?