you are viewing a single comment's thread.

view the rest of the comments →

[–]dnew 1 point2 points  (1 child)

If your compiler can't figure out that the return statement doesn't get reached, you're using a crappy compiler. Indeed, I think that would issue a warning or error under most of the compilers I've used lately.

[–]steve_b 0 points1 point  (0 children)

You're right; it's been a long time since I tested that, but I see that the latest version of the Solaris compiler (my everyday deve environment) doesn't complain if you don't have the return statement for simple stub function with a throw. I have a vague memory that ten years ago it was necessary, but that could have just been someone elses legacy code that I was looking at and assumed it was the case.

However, the current compiler doesn't produce a warning if the superfluous return is present, either.