ID Number: Q69413
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:
With C 6.0a and 6.0ax
---------------------
file.c(5) : fatal error C1001: Internal Compiler Error
(compiler file '@(#)regMD.c:1.110', line 3101)
Contact Microsoft Product Support Services
With C 6.0
----------
file.c(5) : fatal error C1001: Internal Compiler Error
(compiler file '@(#)regMD.c:1.100', line 3074)
Contact Microsoft Product Support Services
These errors will occur under any memory model when using any one of
the following optimizations (although the errors may not occur when
some of these options are combined):
/Oa, /Oc, /Od, /Oi, /On, /Op, /Or, /Os, /Ot, /Ow, or /Oz
RESOLUTION
There are several possible ways to work around these errors:
1. Do not use any of the above options and do not use the default
optimization for the module where the error occurs.
-or-
2. Add /Oe or /Og; one of these combined with other optimizations
may eliminate the problem.
-or-
3. Selectively disable optimizations for the particular function that
is producing the error through use of the optimize pragma.
-or-
4. Rewrite the statement to use an if-else construct instead of the
ternary operator.
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
*/
void func(unsigned char uch1, unsigned char uch2)
{
uch2 = uch1 ? (unsigned char)'0' : (unsigned char)(uch1 % 24);
}