Compiler Error C2142

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at Compiler Error C2142.

function declarations differ, variable parameters specified only in one of them

One declaration of the function contains a variable parameter list. Another declaration does not. ANSI C (/Za) only.

The following sample generates C2142:

// C2142.c  
// compile with: /Za /c  
void func();  
void func( int, ... );   // C2142  
void func2( int, ... );   // OK  

Show: