This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c/3764: Gcc incorrectly complains that a noreturn function returns
On Mon, Jul 23, 2001 at 01:35:53AM -0700, Richard Henderson wrote:
> On Mon, Jul 23, 2001 at 10:17:08AM +0200, Erik Mouw wrote:
> > The way I read this is that the noreturn attribute tells the compiler
> > that the function doesn't return.
>
> It does.
>
> > If the compiler doesn't listen to the directive, it will never
> > be able to perform optimisations, and the attribute is useless.
>
> It did listen to the directive. It also decided that it would
> check up on you to see if you made a mistake. It thought you did.
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.
Compare it with a safe that you want to lock forever. You close the
door, and melt the key. Unfortunately the guy who built the safe
decided that you really don't want that and made a secret button to
open it without a key.
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/