This is the mail archive of the
mailing list for the GCC project.
Re: c/3764: Gcc incorrectly complains that a noreturn function returns
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.
Dr Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
'But that's a lie.' - 'Yes it is. What's your point?'
firstname.lastname@example.org : http://www.cs.bris.ac.uk/~nathan/ : email@example.com