Internal Compiler Error in mactab.c:1.41, Line 685

ID Number: Q35808

5.00 5.10 | 5.10

MS-DOS | OS/2

buglist5.00 buglist5.10

Summary:

When compiled with any options, the code below produces the following

error under C Version 5.00:

fatal error C1001: Internal Compiler Error

(compiler file '@(#)mactab.c:1.40', line 672)

Contact Microsoft Technical Support

Under C Version 5.10, the following error is generated:

fatal error C1001: Internal Compiler Error

(compiler file '@(#)mactab.c:1.41', line 685)

Contact Microsoft Technical Support

Microsoft has confirmed this to be a problem in Versions 5.00 and

5.10. We are researching this problem and will post new information as

it becomes available.

The workaround to this problem is to use an if statement instead of

the conditional operator in the loop, as follows:

for(;;)

{

if( value == 1 )

i = 1;

else

d /= 2.0;

}

More Information:

The following code demonstrates the problem:

#include <stdio.h>

void main(void);

void main()

{

double d = 3.42;

int i;

int value = 1;

for(;;) /* Occurs with any loop i.e. do..while, while, or switch */

{

(value == 1 ) ? i = 1: ( d /= 2.0 ) ;

}

}