NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Compiler Warning (level 1) C4256

'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, ... ) was compiled with a version of Visual C++ prior to 7, but the code snippet here were compiled with current version, the call to the constructor for S3 would not work correctly, due to a special-case calling convention change. Note that if both were compiled with 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 their project are built with the current version (including any libraries that may define or reference this class), then disable the warning using the warning pragma.
// #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.
}