KnowledgeBase Archive

An Archive of Early Microsoft KnowledgeBase Articles

View on GitHub

Q40606: Internal Compiler Error getattrib.c from typedef

Article: Q40606
Product(s): See article
Version(s): 5.10   | 5.10
Operating System(s): MS-DOS | OS/2
Keyword(s): ENDUSER | s_quickc | mspl13_c
Last Modified: 16-MAY-1989

The code below causes the following error in the C Version 5.10
compiler:

   Fatal error C1001:  Internal Compiler Error
   (Compiler file '@(#)getattrib.c:1.42' line 170)
   Contact Microsoft Tech Support

In C Version 5.00, the error will be in the following:

   (Compiler file '@(#)getattrib.c:1.40' line 162)

In the QuickC compilers, it has random results, including hanging the
machine, returning to the editor after compilation with no messages,
and entering debug mode.

The following code demonstrates the problem:

typedef struct {
               char  foo;
               float bar;
               int   baz;
               }                /* missing declarator, semicolon */
void main(void)
{
}

The error occurs whenever the declarator and terminating semicolon are
both omitted. If the declarator is present, but there is no semicolon,
then the compiler catches the error.

The declarator and semicolon are both syntactically mandatory to
conform to the ANSI draft standard; however, C Versions 5.x0 and
QuickC Versions 1.0x allow a typedef without a declarator to compile
if the semicolon is present. The proper statement is as follows:

typedef struct {
               char  foo;
               float bar;
               int   baz;
           }  boink;

void main(void)
{
}

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.