typedef's & cc

Richard Draves draves at harvard.ARPA
Mon Nov 12 14:12:37 AEST 1984

Don't the normal scope rules hold for typedef?
The following program produced errors under 4.2BSD:

typedef int foo;

	auto int foo;

	foo = 2;

"test.c", line 5: illegal type combination
"test.c", line 7: syntax error
"test.c", line 7: warning: illegal combination of pointer and integer, op =
"test.c", line 7: unknown size
"test.c", line 7: cannot recover from earlier errors: goodbye!

Stylistic considerations aside, why isn't foo a variable inside main,
and a type outside?  And why can't cc recover from such simple errors?


More information about the Comp.lang.c mailing list