BUG: Based Variable EXTRN Directive Incorrect in ASM, COD File

Last reviewed: July 17, 1997
Article ID: Q66773
6.00 6.00a 6.00ax 7.00 | 6.00 6.00a | 1.00 1.50
MS-DOS                 | OS/2       | WINDOWS
kbtool kbbuglist

The information in this article applies to:

   The Microsoft C/C++ Compiler (CL.EXE) included with:
    - Microsoft C for MS-DOS, versions 6.0, 6.0a, and 6.0ax
    - Microsoft C for OS/2, versions 6.0, and 6.0a
    - Microsoft C/C++ for MS-DOS, version 7.0
    - Microsoft Visual C++ for Windows, versions 1.0 and 1.5

SYMPTOMS

In an assembly language listing (.ASM file) or in a mixed source code and assembly language listing (.COD file), the EXTRN directive for based variables is not located in the correct section of the listing file. This error also occurs for functions specified in an alloc_text pragma.

RESOLUTION

To work around this problem, edit the listing file to place the EXTRN directive for a based variable between the SEGMENT and ENDS directives for the segment in which the variable is declared to exist.

STATUS

Microsoft has confirmed this to be a bug in the products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

To generate an assembly language listing file with Microsoft C, specify the /Fa compiler option switch. To generate a mixed source code and assembly language listing file, specify the /Fc compiler option switch.

The EXTRN directive for a based variable belongs between the SEGMENT and ENDS directives for the segment in which the variable is declared to exist. This allows the Microsoft Macro Assembler (MASM) to generate the correct fixups for references to the variable which, in turn, enables the linker to determine whether the variable is actually defined in the specified segment.


Additional reference words: 1.00 1.50 6.00 6.00a 6.00ax 7.00 8.00 8.00c
_based
KBCategory: kbtool kbbuglist
KBSubcategory: CLIss
Keywords : kb16bitonly


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: July 17, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.