Here is the C ++ function:
int FuncWithoutReturn()
{
int var = 10;
++var;
}
In MSVC, the compiler generates an error:
error C4716: "FuncWithoutReturn": value must be returned.
But in Xcode 5, the compiler just spits out a warning:
Control reaches the end of a non-void function
At runtime, if I'm lucky, the application crashes. I know this is a stupid mistake, but it would be nice for the compiler to give the error in the first place.
Just wondering, does anyone know why Xcode thinks this is a warning, not an error.
source
share