C1001: Internal Compiler Error: p3io.c, Line 743

ID Number: Q44093

5.00 5.10 | 5.10

MS-DOS | OS/2

buglist5.10 fixlist6.00

Summary:

The Microsoft C Compiler version 5.1 produces the following internal

compiler error when the sample program below is compiled with default

optimization:

fatal error C1001: Internal Compiler Error

(compiler file '@(#)p3io.c:1.115', line 743)

Contact Microsoft Technical Support

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

problem was corrected in C version 6.0.

Sample Code

-----------

/* Compile options needed: none

*/

extern int a() ;

void (* sptrs[][])() = { a } ;

More Information:

The declaration "void (*sptrs[][])() = {a};" is not valid because ONLY

the first dimension bound can be omitted in an array declaration. The

compiler should generate the error message "C2087: missing subscript"

for this declaration.

Correcting the invalid declaration by supplying a constant expression

in the second pair of brackets eliminates the internal compiler error.

The correct declaration may appear as follows:

void (* sptrs[][10])() = {a} ;

Or, if a type specifier other than "void" is used, as in either of the

following declarations, the C compiler will issue an expected error

message, "C2087 : 'sptrs' missing subscript":

int (* sptrs[][])() ;

int (* sptrs[][])() = {a} ;

If the original declaration does not have the initializer, as in the

following, the C compiler will not issue the internal compiler error

but will not check the invalid declaration either:

void (* sptrs[][]) () ;