C9008000: C1001: regMD.c, Line 929

ID Number: Q64564

6.00 6.00a 6.00ax | 6.00 6.00a

MS-DOS | OS/2

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

Summary:

SYMPTOMS

The Microsoft C Compiler versions 6.0, 6.0a, and 6.0ax produce the

following internal compiler error when the sample program below is

compiled with all optimization disabled (/Od):

file.c(16) : fatal error C1001: Internal Compiler Error

(compiler file '@(#)regMD.c:1.100', line 929)

Contact Microsoft Product Support Services

RESOLUTION

The workaround for this problem is to either compile with the /qc

(quick compile) option or to simplify the expression.

One way of simplifying the nested macro expression is to call each

macro separately. For instance, the following is a feasible

workaround:

1. Redefine the Get macro as follows:

#define Get(x,y,z) \

((((x) == 183) ? (y) : (z))

2. Then for every call to the Get macro, use the following two

statements:

temp = Rev(x);

l = Get(Order,*pl,temp);

STATUS

Microsoft has confirmed this to be a problem in C versions 6.0,

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

More Information:

Sample Code

-----------

/* Compile options needed: /Od

*/

#define Rev(x) ( ( (x) >> 24 ) | \

( ( (x) & 0xff0000 ) >> 8 ) | \

( ( (x) & 0x00ff00 ) << 8 ) | \

( (x) << 24) )

#define Get(x,y) \

(((x) == 183) ? (y) : Rev(y))

void main (void)

{

long l;

long *pl;

int Order;

l = Get(Order,*pl); // This line causes the error.

}

Additional reference words: 6.00 6.00a 6.00ax