Condividi tramite


Errore del compilatore C2617

'function': istruzione return incoerente

Osservazioni:

La funzione specificata non ha un tipo restituito dichiarato e un'istruzione return precedente non ha fornito un valore.

Example

L'esempio seguente genera l'errore C2617:

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

Possibile soluzione:

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