Compiler Warning (level 1) C4256 (Windows CE 5.0)

Send Feedback

'function' : constructor for class with virtual bases has '...';
calls may not be compatible with older versions of Visual C++

Possible incompatibility.

Based on the code sample below, if the definition of the constructor S2::S2( int i, ... ) were compiled with a version of Microsoft® eMbedded Visual C++® prior to 6.1, but the code snippet here were compiled with 6.1, the call to the constructor for S3 would not work correctly, due to a special-case calling convention change. If both were compiled with eMbedded Visual C++ 6.0, the call would not work quite right either, unless no parameters were passed for the ellipsis.

To resolve this warning,

  1. Don't use ellipsis in a constructor.

  2. Make sure that all components in a project are built with VC6.1 (including any libraries that may define or reference this class), then disable the warning using the warning

    // #pragma warning(disable : 4256)
    struct S1 {};
    struct S2: virtual public S1 {
    S2( int i, ... );  // C4256 issued here
    };
    
    void func1() {
    S2 S3( 2, 1, 2 );  // C4256 issued here as well.
    }
    

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.