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

Send Feedback

'function' : behavior change due to parameter 'parameter': calling convention incompatible with previous compiler versions

This warning is specific to the C++ compiler for the ARM(R) Architecture. Versions of the compiler older than 14.00 use a different calling convention than 14.00, and newer compilers pass certain function parameters by value. The two calling conventions are not compatible, and linking object files from an older compiler with newer object files can result in unpredictable behavior and crashes if such a parameter is passed by value between the old and new object files.

An object of class, struct, or union type with a user-defined copy constructor is subject to this calling convention change if it is passed by value. Objects passed by reference are not affected.

Use this warning to find places in your code where the calling convention has changed. If objects with user-defined copy constructors are passed by value between old and new object files, the old object files must be recompiled with a compiler version 14.00 or greater.

This warning is off by default.

The following sample generates C4567:

// C4567.cpp
// (optional) compile with: -w14567 instead of using #pragma warning
#pragma warning(default : 4567)
#pragma inline_depth(0) // disable function inlining

#include <cstdio>

struct S {
   S () { self = this; }
   S (S& that) { self = this; }
   ~S() {  // older compilers will fail this test
      if ( self != this ) {
         printf ("s passed incorrectly\n");
      }
   }
   S* self;
};

void func ( S s ) // C4567 at definition
{
   // s destructor is called here
}

int main()
{
   S s;
   func (s); // C4567 at call site
   return 0;
}

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.