Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

Compiler Error C2617

Error Message

'function' : inconsistent return statement

The specified function does not have a declared return type, and a previous return statement did not supply a value.

The following sample generates C2617:

// C2617.cpp
int i;
func() {   // no return type prototype
   if( i ) return;   // no return value
   else return( 1 );   // C2617 detected on this line

Possible resolution:

// C2617b.cpp
// compile with: /c
int i;
int MyF() {
   if (i)
      return 0;
      return (1);

Community Additions

© 2015 Microsoft