BUG: C1001: grammar.c, Line 155, Constructor Argument ListLast reviewed: July 17, 1997Article ID: Q100966 |
7.00 7.00a | 1.00 1.50
MS-DOS | WINDOWSkbtool kbbuglist The information in this article applies to:
SYMPTOMSAn attempt to compile, with the optimizing compiler, a class constructor that accepts a variable number of arguments fails and Microsoft C/C++ generates the following message:
test.cpp(20) : fatal error C1001: INTERNAL COMPILER ERROR (compiler file '@(#)grammar.c:1.147', line 155) Contact Microsoft Product Support ServicesDepending on the complexity of the source code, the error may occur on line 156, 179, or 180 in GRAMMAR.C, rather than on line 155. The error occurs regardless of the specified optimizations. If the compiler command line includes the /Ox option switch, the following error may occur prior to the C1001 error listed above:
test.cpp(20) : warning C4713: _aab: INTERNAL COMPILER ERROR; restarting (compiler file '@(#)grammar.c:1.147', line 155) Contact Microsoft Product Support Services CAUSEThis error is caused by a problem optimizing the variable argument list in the class constructor. The error occurs only for the actual constructor call (not for the declaration), and occurs only when the number of arguments exceeds a limit that varies depending on the complexity of the code. In the sample code below, the error occurs when the constructor call specifies between 53 and 98 arguments. If the call specifies fewer than 53 arguments, no error occurs. If the call specifies more than 98 arguments, the compiler generates the following warning message:
test.cpp(20) : fatal error C1035: expression too complex; simplify expression RESOLUTIONTo address this situation, perform one of the following two steps:
STATUSMicrosoft has confirmed this to be a problem in C/C++ versions 7.0, 7.0a, and 8.0 for MS-DOS. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available. This problem does not occur with C/C++ 32-bit compiler versions 8.0 or 9.0, included with Visual 32-bit Edition, versions 1.0 and 2.0, because the /f option is not supported.
MORE INFORMATIONThe following code example demonstrates this error when you compile it with the optimizing compiler (using the specified options):
Sample Code
/* * Compile options needed: /c /f- */ #include <stdarg.h> // Required for code that uses // variable number of argumentsclass N {public: N(int ar, ...) {} };static const N title(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 20, 1, 2, 3, 4, 5, 6, 7, 8, 9, 30, 1, 2, 3, 4, 5, 6, 7, 8, 9, 40, 1, 2, 3, 4, 5, 6, 7, 8, 9, 50, 1, 2, 3, 4, 5, 6, 7, 8, 9, 60, 1, 2, 3, 4, 5, 6, 7, 8, 9, 70, 1, 2, 3, 4, 5, 6, 7, 8, 9, 80, 1, 2, 3, 4, 5, 6, 7, 8, 9, 90, 1, 2, 3, 4, 5, 6, 7, 8 ); |
Additional reference words: 1.00 1.50 7.00 7.00a 8.00 8.00c
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |