This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: egcs, RFC: patch for possible -Wmissing-noreturn warning
- To: Martin Mares <mj at ucw dot cz>
- Subject: Re: egcs, RFC: patch for possible -Wmissing-noreturn warning
- From: John Carr <jfc at mit dot edu>
- Date: Tue, 13 Oct 1998 20:37:05 EDT
- Cc: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>, egcs at cygnus dot com
> There are three possible cases:
> ...
> [3] Functions that contain jumps and don't fall into the previous category.
> Since the Halting Problem is uncomputable, you cannot tell whether they
> return or not which makes warnings of this case impossible.
The halting problem says that given an infinite system you can't write
a perfect theorem prover. It doesn't say that you can't get most
cases right. (It also doesn't apply to finite systems where it is
possible to enumerate all the possible states, but that's not an
important exception here.)
gcc needs to be careful with return/noreturn warnings because there
are three states, not two (like IEEE compares), but it should be
possible to arrange that:
1. every return/noreturn warning is correct
2. most functions which should have warnings get them