The problem with ``add this line before return'' solutions is that they are useless if the code does not reach that line. By instance:
- there is a call to `exit()' or `abort()'
- an exception is thrown and not catch
- there is a fatal error (segmentation fault)
However, if you run your program from the console, when it terminates you are left in the console.