This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: egcs, RFC: patch for possible -Wmissing-noreturn warning
- To: jbuck at Synopsys dot COM
- Subject: Re: egcs, RFC: patch for possible -Wmissing-noreturn warning
- From: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Date: Tue, 13 Oct 1998 14:27:27 -0400 (EDT)
- Cc: egcs-patches at cygnus dot com, egcs at cygnus dot com, mj at ucw dot cz
> From: Joe Buck <jbuck@Synopsys.COM>
>
> [ determining whether a function will return ]
>
> > Yes, but IMHO, this isn't the halting problem. Its not
> > whether it *will* return but whether its *possible* to return. Ie,
> > what are the exit points of the function? Does it `return', fall off
> > its end or call abort/exit/longjmp/{some other `noreturn' function}?
>
> If we require an exact solution (given any function, can it return?), then
> it is equivalent to the halting problem. But we don't require an exact
> solution (if we can't tell whether the function returns or not, we assume
> that it returns).
Exactly my point. If your statement is true, (that in the
undetermined state we assume it *returns*) then gcc is giving false
information.
A one line static inline function that simply does one
assignment is being flagged as *not* returning. Jeff has commented that
gcc may be prematurely short circuiting this calculation in the case of
static inlines. I agree.
--Kaveh
--
Kaveh R. Ghazi Engagement Manager / Project Services
ghazi@caip.rutgers.edu Icon CMT Corp.