C linkage query
Shankar Unni
shankar at hpclscu.HP.COM
Wed Jun 14 05:55:35 AEST 1989
> > >I.e., if you compile a file containing
> > > extern int foo;
> > > main() {}
> > >and link that *with no other object files and with no libraries that
> > >define "foo"*, will the link fail?
> I have since learned that this is explicitly legal in ANSI C.
True. Section 3.7.1, footnote 75 in the Dec 88 draft.
>From the Dec 88 dpANS:
75. Thus, if an identifier declared with external linkage is not used
in an expression, there need be no external definition for it.
---
Shankar.
More information about the Comp.lang.c
mailing list