Article ID: 133179 - Last Review: July 5, 2005 - Revision: 2.1

BUG: Compiler Fails Syntax Check of Extra Comma in enum List

This article was previously published under Q133179

On This Page

Expand all | Collapse all

SYMPTOMS

The compiler syntax checker does not detect the presence of a trailing comma in an enum list declaration.

RESOLUTION

Do not use a comma at the end of an enum list declaration.

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

An extra comma at the end of an initializer in braces as in the following is allowed, however, it should not be allowed in enum lists:
   { ... , },
				

Sample Code to Demonstrate Problem

   /* Compile options needed: None
   */ 

   enum enmX { ka =0, kb = 1, };   // No error or warning in this line
   void main(void){}
				

APPLIES TO
  • Microsoft Visual C++ 1.0 Professional Edition
  • Microsoft Visual C++ 1.5 Professional Edition
  • Microsoft Visual C++ 1.51
  • Microsoft Visual C++ 1.52 Professional Edition
  • Microsoft Visual C++ 2.0 Professional Edition
  • Microsoft Visual C++ 2.1
  • Microsoft Visual C++ 2.2
  • Microsoft Visual C++ 4.0 Standard Edition
  • Microsoft Visual C++ 4.1 Subscription
  • Microsoft Visual C++ 4.2 Professional Edition
  • Microsoft Visual C++ 5.0 Enterprise Edition
  • Microsoft Visual C++ 6.0 Enterprise Edition
  • Microsoft Visual C++ 5.0 Professional Edition
  • Microsoft Visual C++ 6.0 Professional Edition
  • Microsoft Visual C++, 32-bit Learning Edition 6.0
  • Microsoft Visual C++ .NET 2002 Standard Edition
  • Microsoft Visual C++ .NET 2003 Standard Edition
Keywords: 
kbbug kbpending kbcompiler KB133179
 

Article Translations

 

Related Support Centers