Microsoft KB Archive/66778

= FIX: Error Messages May Say &quot;short&quot; or &quot;int&quot; Instead of &quot;enum&quot; =

Article ID: 66778

Article Last Modified on 7/5/2005

-

APPLIES TO


 * Microsoft C Professional Development System 6.0
 * Microsoft C Professional Development System 6.0a
 * Microsoft C Professional Development System 6.0a
 * Microsoft C Professional Development System 6.0
 * Microsoft C Professional Development System 6.0a
 * Microsoft C/C++ Professional Development System 7.0
 * Microsoft Visual C++ 1.0 Professional Edition
 * Microsoft Visual C++ 1.5 Professional Edition
 * Microsoft Visual C++ 5.0 Learning Edition
 * Microsoft Visual C++ 2.0 Professional Edition
 * Microsoft Visual C++ 4.0 Professional Edition

-



This article was previously published under Q66778



SYMPTOMS
Because an enumerated type is handled internally the same as a short type, certain compiler error messages may refer to a &quot;short&quot; even though the error involves an &quot;enum&quot;. The following sample code contains an error to demonstrate this situation: enum {A, B, C}     /* missing ';' at end */ double y; When the above code is compiled with the Microsoft C compiler, the following error message is generated:

error C2139: type following 'short' is illegal

Visual C++ for Windows and Visual C++ 32-bit Edition return:

error C2632: 'int' followed by 'double' is illegal

In this particular case, the error should say:

type following 'enum' is illegal&quot;

However, the compiler does not keep track of whether or not an item was specified as an enum.



STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This bug was corrected in Visual C++ version 5.0.

Visual C++ 5.0 compiler generates the following error message:

error C2628: '__unnamed' followed by 'double' is illegal (did you forget a ';'?)

Additional query words: 8.00 8.00c 9.00

Keywords: kbbug kbfix kbvc500fix kbcompiler KB66778

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.