PRB: Nesting for-loops Too Deep Gives C1026 Error

ID Number: Q66784

5.10 6.00 6.00a 6.00ax | 5.10 6.00 6.00a

MS-DOS | OS/2

buglist5.10 buglist6.00 buglist6.00a buglist6.00ax fixlist7.00

Summary:

SYMPTOMS

The Microsoft C Compiler versions 5.1, 6.0, 6.0a, and C 6.0ax are

limited in the number of levels deep allowed for nested for-loops.

Attempts to nest for-loops too deep will result in the error:

C1026: parser stack overflow, please simplify your program.

CAUSE

There is no specific limit to the nesting level because the parser

stack capacity depends on the actual contents of the code, but the

overflow generally occurs with for-loop nesting about 10 to 15

levels deep. This is an arbitrary limit and it will be increased in

the future to ensure compatibility with the 15 nesting-level

minimum specified in the ANSI specification.

STATUS

Microsoft has confirmed this to be a problem in C versions 5.1,

6.0, 6.0a, and 6.0ax. This problem was corrected in C/C++ version

7.0.

Additional reference words: 5.00 5.10 6.00 6.00a 6.00ax