BUG: Block-Data Subprograms Are Not Global Symbols (118432)
The information in this article applies to:
- Microsoft FORTRAN PowerStation for MS-DOS 1.0
- Microsoft FORTRAN PowerStation for MS-DOS 1.0a
- Microsoft Fortran Powerstation 32 for Windows NT 1.0
This article was previously published under Q118432 SYMPTOMS
When an object module containing only a block-data subprogram is placed
in a library and that library is used to link to an executable file, the
block-data subprogram is not linked to the executable file: no data
initialization is performed.
According to the ANSI specification for FORTRAN 77, it is possible for a
program to include a block-data module by making an external reference to
the block-data subprogram.
CAUSE
The linker links modules from a library only when the modules each contain
a global symbol that matches an external reference to a procedure. Because
a block-data module contains no global procedure names, the linker cannot
be made to link the block-data module to the executable file.
RESOLUTION
In order to work around the problem, do one of the following:
- Place the block-data subprogram definition in the same module as a non-
block-data subprogram definition. When an external reference is made to
the non-block-data subprogram, the entire module (including the block-
data subprogram) is then linked to the executable file.
-or-
- Do not put the block data module into a library; instead, link the
block-data module explicitly.
STATUS
Microsoft has confirmed this to be a bug in the FORTRAN PowerStation for MS-
DOS, versions 1.0 and 1.0a, and the FORTRAN PowerStation 32 for Windows NT,
version 1.0. We are researching this problem and will post new information
here in the Microsoft Knowledge Base as it becomes available.
Modification Type: | Major | Last Reviewed: | 10/17/2003 |
---|
Keywords: | KB118432 |
---|
|