Yesterday, I found myself writing code like this:
SomeStruct getSomeStruct()
{
SomeStruct input;
cin >> input.x;
cin >> input.y;
}
<
Falling off the end of a function that is declared to return a value (without explicitly returning a value) leads to undefined consequences. For gcc, you should start with the -Wall command line switch that turns on most useful warnings. The specific gcc warning that controls the warning you want is -Wreturn-type (which is included in -Wall, I just mention this for completeness).
Once you have warnings turned on, you should also use -Werror to treat warnings as errors and make the build stop at the point it detects an error.