This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: egcs, RFC: patch for possible -Wmissing-noreturn warning




> 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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]