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

Kaveh R. Ghazi ghazi@caip.rutgers.edu
Tue Oct 13 12:05:00 GMT 1998


 > 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.



More information about the Gcc-patches mailing list