KnowledgeBase Archive

An Archive of Early Microsoft KnowledgeBase Articles

View on GitHub

Q51835: "Error C2410: ‘var’ : Ambiguous Member Name Operand 2"

Article: Q51835
Product(s): See article
Version(s): 2.00 2.01
Operating System(s): MS-DOS
Keyword(s): ENDUSER | buglist2.01 | mspl13_c
Last Modified: 14-MAR-1990

The following code generates the following error:

   file.c(x) : error c2410: 'var' : ambiguous member name operand 2

Code Example
------------

void main (void)
{
     struct tag1
     {
          int  member;   <---|
     } name1;                |
                             |---- two different structures with
     struct tag2             |     same member name
     {                       |
          int  member;   <---|
     } name2;

     _asm      mov  bx, name2.member;
}

The compiler is confused by the two members with the same name.
However, this behavior is observed only when referencing the structure
member in an in-line assembly statement. If the member is referenced
in a C statement, no error will occur. The only current workaround is
to have different member names.

Microsoft has confirmed this to be a problem in QuickC Version 2.10.
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.