This is the mail archive of the gcc-bugs@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: c/3764: Gcc incorrectly complains that a noreturn function returns


On Mon, Jul 23, 2001 at 12:48:47PM +0100, Nathan Sidwell wrote:
> 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.

So that means that the caller will still be optimised for a noreturn
function?

> Perhaps the documentation should be clarified.

What you said above certainly clarified it. Just add it to the manual.


Erik

-- 
J.A.K. (Erik) Mouw, Information and Communication Theory Group, Department
of Electrical Engineering, Faculty of Information Technology and Systems,
Delft University of Technology, PO BOX 5031,  2600 GA Delft, The Netherlands
Phone: +31-15-2783635  Fax: +31-15-2781843  Email: J.A.K.Mouw@its.tudelft.nl
WWW: http://www-ict.its.tudelft.nl/~erik/


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