If a function is declared with a void return value (no return value), then it is an error for the function definition to return any value.
If a function is declared with a non-void return value (returns some value or object), then it is NOT an error if the function definition fails to return a value. Some compilers generate missing-return-value warnings about this.
What is the reason for this? To me it would make sense to have these swapped, so that an error is generated if you fail to return a value, and you only get a warning if you try to return a value from a function that is declared with a void return type.