c/3764: Gcc incorrectly complains that a noreturn function returns

Nathan Sidwell nathan@codesourcery.com
Mon Jul 23 04:48:00 GMT 2001


Erik Mouw wrote:

> I _know_ the function can't return, that's exactly the reason why I
> told the compiler. The compiler shouldn't try to outsmart the user and
> decide that I made a mistake. If that allows the user to shoot himself
> in the foot, so be it.
Think of the attribute as part of the function's prototype. It is telling
callers (who have no knowledge of the function definition), that it
will not return to them. Just as, say checking the return statements
matches the prototype, the compiler checks to see if it can
fall off the end. Perhaps the documentation should be clarified.

nathan

-- 
Dr Nathan Sidwell   ::   http://www.codesourcery.com   ::   CodeSourcery LLC
         'But that's a lie.' - 'Yes it is. What's your point?'
nathan@codesourcery.com : http://www.cs.bris.ac.uk/~nathan/ : nathan@acm.org



More information about the Gcc-bugs mailing list