ID Number: Q61312
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 errors when the sample program below is
compiled with default optimization or any of these options:
/Oa /Oc /Oi /On /Op /Or /Os /Ot /Ow /Oz
With C 6.0a and 6.0ax
---------------------
file.c(27) : fatal error C1001: Internal Compiler Error
(compiler file '@(#)regMD.c:1.100', line 3101)
Contact Microsoft Product Support Services
With C 6.0
----------
file.c(27) : fatal error C1001: Internal Compiler Error
(compiler file '@(#)regMD.c:1.100', line 3074)
Contact Microsoft Product Support Services
RESOLUTION
The errors may be eliminated one of with the following workarounds:
1. Add one of the following optimizations to those listed above:
/Od /Oe /Og /Ol /Ox
-or-
2. Use temporary variables to hold the intermediate results before
the "if" statement.
-or-
3. Compile with the /qc (quick compile) option.
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: none
*/
typedef struct
{
short cursize; /* The current size of this buffer. */
short nextscan; /* The offset of the next scan entry.*/
} struct1;
typedef struct
{
short len; /* Buffer entry length */
} struct2;
void main(void)
{
char far *cfptr1;
char far *cfptr2;
struct1 far *s1ptr;
struct2 far *s2ptr;
short lenToMove;
s1ptr = (struct1 far *) cfptr1;
cfptr2 = (char far *) s2ptr + s2ptr->len;
lenToMove = s1ptr->cursize - (short)((long)cfptr2 - (long)cfptr1);
if ((cfptr1 + s1ptr->nextscan) >= cfptr2) // Line 24
s1ptr->nextscan -= s2ptr->len;
}
Additional reference words: 6.00 6.00a 6.00ax