The attached code demostrates a host association bug with a declaration of an external function in a module. The incorrect reference can be verified by looking at the assembler or object files generated.
% gfc gfcbug53.f90 /tmp/ccDZrLiD.o(.text+0x37): In function `__mod2__foo': : undefined reference to `__mod2__extfunc' % gfc gfcbug53.f90 -c && nm gfcbug53.o |grep extfunc U __mod2__extfunc 00000047 T extfunc_ See the lines real, external :: extfunc ! This EXTERNAL refers to the wrong namespace ! Check with: nm gfcbug53.o |grep extfunc and the attached code for details. Cheers, -ha -- Summary: Host association bug w/ EXTERNAL Product: gcc Version: 4.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: anlauf at gmx dot de GCC host triplet: i686-pc-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30410