C9107000: C1001: regMD.c, Lines 3074 and 3101

ID Number: Q74531

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 any optimization that does not include either the

/Oe, /Ol, or /Og optimization:

C 6.0a and 6.0ax

----------------

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

(compiler file '@(#)regMD.c:1.110', line 3101)

Contact Microsoft Product Support Services

C 6.0

-----

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

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

Contact Microsoft Product Support Services

RESOLUTION

These errors may be eliminated with the following workarounds:

- Compile with /Ol, /Oe, /Og, or /Ox in addition to any other

optimizations specified.

-or-

- Use the optimize pragma to turn on one of the above

optimizations for the function containing the line which causes

the error.

-or-

- 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

*/

#include <DOS.H>

#include <string.h>

char genbuf[64];

void log_date (void)

{

register char i, j;

union REGS regs;

static char *month[] = { "", "Jan", "Feb", "Mar", "Apr", "May",

"Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };

regs.h.ah = 0x2a;

intdos(&regs, &regs);

j = sprintf(genbuf," run time: %d %s %4d, ",

regs.h.dl, month[regs.h.dh], regs.x.cx);

regs.h.ah = 0x2c;

intdos(&regs, &regs);

i = (char)(regs.h.ch % 12 == 0 ? 12 : regs.h.ch % 12);

}

Additional reference words: 6.00 6.00a 6.00ax