Kompilatorfel C2617

"function" : inkonsekvent retursats

Anmärkningar

Den angivna funktionen har ingen deklarerad returtyp och en tidigare retursats angav inte något värde.

Example

I följande exempel genereras C2617:

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

Möjlig lösning:

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