extern question

Tom Karzes karzes at mfci.UUCP
Wed Jul 6 06:07:46 AEST 1988


In article <8213 at brl-smoke.ARPA> gwyn at brl.arpa (Doug Gwyn (VLD/VMB) <gwyn>) writes:
}Same thing, but include "static" in all declarations that mention
}them, particularly the first.
}
}	static struct foo x;
}	static struct bar y;
}	static struct foo x = { 123, &y };
}	static struct bar y = { 456, &x };

That might work in ANSI C, but it isn't legal K&R C.  In K&R C the second
declarations of x and y constitute illegal redeclarartions, and with the
compilers I've tried compilation fails with a user error.



More information about the Comp.lang.c mailing list