Compartir a través de


Error del compilador C2617

"función": Instrucción "return" incoherente

La función especificada no tiene un tipo de valor devuelto declarado y una instrucción return anterior no ha proporcionado ningún valor.

El ejemplo siguiente genera el error C2617:

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

Posible solución:

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