C9202002: COMM Declarations Incorrect in Assembly Listings

ID Number: Q81366

6.00 6.00a 6.00ax | 6.00 6.00a

MS-DOS | OS/2

buglist6.00 buglist6.00a buglist6.00ax fixlist7.00

Summary:

PROBLEM ID: C9202002

SYMPTOMS

Under compact (/AC), large (/AL), or huge (/AH) memory models,

Microsoft C versions 6.0, 6.0a, and 6.0ax produce COMM declarations

in both the assembly (/Fa) or combined source-assembly (/Fc)

listings that are different from the actual code generated.

This will usually only cause problems if the listing is assembled

and used in mixed language programming.

CAUSE

The compiler is generating COMM NEAR declarations in listing files

for all communal data, regardless of the memory model. In compact,

large, and huge memory models, the compiler generates COMM FAR

declarations; therefore, the listing file does not match the code

that is generated.

STATUS

Microsoft has confirmed this to be a problem in Microsoft C

versions 6.0, 6.0a, and 6.0ax. This problem was corrected in C/C++

version 7.0.

More Information:

In the sample code below, the following declaration is generated for

for the variable 'peanut' in the listing file:

COMM NEAR _peanut

The compiler should generate the following declaration for the listing

file:

COMM FAR _peanut

Sample Code

-----------

/* Compile options needed: /AL /Fa

*/

int peanut;

void main( )

{

peanut = 17;

}

Additional reference words: 6.00 6.00a 6.00ax