BUG: Structure Tags Visible Outside of Function Prototype Scope (67041)
The information in this article applies to:
- Microsoft C/C++ for MS-DOS 7.0
- Microsoft Visual C++ for Windows, 16-bit edition 1.0
- Microsoft Visual C++ for Windows, 16-bit edition 1.5
- Microsoft Visual C++, 32-bit Editions 1.0
- Microsoft Visual C++, 32-bit Editions 2.0
- Microsoft Visual C++, 32-bit Editions 4.0
- Microsoft Visual C++, 32-bit Editions 4.1
- Microsoft Visual C++, 32-bit Editions 4.2
- Microsoft Visual C++, 32-bit Editions 5.0
This article was previously published under Q67041 SYMPTOMS
The 16-bit compilers listed above incorrectly generate the follow error
message:
error C2025: 'tag1': enum/struct/union type redefinition
In Visual C++32-bit Edition, the following error is incorrectly generated:
error C2011: 'tag1' : 'union' type redefinition
CAUSE
The scope of an identifier in C is determined by the placement of its
declaration. According to the ANSI specification, if an identifier's
declarator or type specification appears within a list of parameter
declarations in a function prototype, the identifier is said to have
"function prototype scope." This scope terminates at the end of the
function prototype. In the C and QuickC compilers, this scope is not
correctly terminated for structure and union tags, and a C2025 error may be
incorrectly generated.
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.
Modification Type: | Minor | Last Reviewed: | 7/5/2005 |
---|
Keywords: | kbBug kbCompiler KB67041 kbAudDeveloper |
---|
|