C1001: Internal Compiler Error: exphelp.c, Line 452

ID Number: Q30310

5.10 | 5.10

MS-DOS | OS/2

buglist5.10 fixlist6.00

Summary:

The C version 5.10 compiler produces the following internal compiler

error when the sample program below is compiled with optimization /Ot

(the default) or /Ox, and /AL or /AC:

C1001 INTERNAL COMPILER ERROR

Compiler file '@(#)exphelp.c:1.75', line 452

Contact Microsoft Technical Support

The workaround for this error is to optimize /Od[ialts] or to change

the following line

s [ str - s ] = '\s';

to the following:

i = str - s;

s [ i ] = '\s';

Microsoft has confirmed this to be a problem in C version 5.10. This

problem was corrected in C version 6.00.

Sample Code

-----------

The program that causes the error above is as follows:

#include <stdio.h>

#include <string.h>

char *getmen(char *, int);

void main()

{

char s[6], t[3], *str;

int menu = 0;

strcpy (s, getmen("grafx.men",menu));

if ((str=strchr(s,'.')) != NULL)

{

strcpy(t, str+1);

s[str - s]='\s';

}

else

{

t[0] = '\0';

}

}