Ever since I realized many years ago, that this doesn\'t produce an error by default (in GCC at least), I\'ve always wondered why?
I understand that you can issue co
Under what circumstances doesn't it produce an error? If it declares a return type and doesn't return something, it sounds like an error to me.
The one exception I can think of is the main()
function, which doesn't need a return
statement at all (at least in C++; I don't have either of the C standards handy). If there is no return, it will act as if return 0;
is the last statement.