KnowledgeBase Archive

An Archive of Early Microsoft KnowledgeBase Articles

View on GitHub

Q67235: C1001: Internal Compiler Error: grammar.c, Line 140

Article: Q67235
Product(s): See article
Version(s): 6.00a  | 6.00a
Operating System(s): MS-DOS | OS/2
Keyword(s): ENDUSER | buglist6.00a | mspl13_c
Last Modified: 29-NOV-1990

Compiling the sample code below with default optimizations and a
memory model with far data (/AL or /AC) will result in the following
error:

   sample.c(15) : fatal error C1001: Internal Compiler Error
                  (compiler file '../grammar.c', line 140)
                  Contact Microsoft Product Support Services

The following are valid workarounds:

1. Compile with /Od (optimizations disabled).

2. Use the optimize pragma to disable optimizations for the function
   in which the error occurs.

3. Compile in the small or medium memory model.

4. Compile with the /qc (quick compile) option.

5. Assign the "0 - msc.a" expression to a temporary variable, and
   assign the temporary variable to msc.a on line 15.

Sample Code
-----------

 1: void foo(void);
 2: void sub(void);
 3:
 4: struct _msc
 5: {
 6:    long a;
 7: };
 8:
 9: extern struct _msc msc;
10:
11: void sub()
12: {
13:    msc.a = 0 - msc.a;
14:    foo();
15:    msc.a = 0 - msc.a;
16: }

Microsoft has confirmed this to be a problem in C version 6.00a. We
are researching this problem and will post new information here as it
becomes available.

THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Copyright Microsoft Corporation 1986-2002.