ansi weirdness

Andrew Hume andrew at alice.UUCP
Fri Sep 7 23:01:34 AEST 1990


the following C fragment fails with a strict ANSI compiler (lcc)
but compiles with sloppy ones (e.g. gcc):

	typedef int (*fn)(struct x *);
	extern int fn1(struct x *);
	extern fn *fp = fn1;

the ostensible reason is that the two struct x's are different
(or at least, have different scopes).
this may be technically correct but is just wrong.
can anyone explain why anyone would want this batshit behaviour?



More information about the Comp.lang.c mailing list