Erro do compilador C2617
“function”: instrução de retorno inconsistente
A função especificada não tem um tipo de retorno declarado e uma instrução de retorno anterior não forneceu um valor.
O exemplo a seguir gera o erro C2617:
// C2617.cpp
int i;
func() { // no return type prototype
if( i ) return; // no return value
else return( 1 ); // C2617 detected on this line
}
Resolução possível:
// C2617b.cpp
// compile with: /c
int i;
int MyF() {
if (i)
return 0;
else
return (1);
}