In most recent C compilers you can turn on warnings for at least missing return values from functions and not having a default: in a switch.
It is good practice to compile C/C++ programs with high warning level, and fix all the warnings before shipping.