This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: -fobey-inline (was Re: gcc and inlining)
- From: Ziemowit Laski <zlaski at apple dot com>
- To: dewar at gnat dot com (Robert Dewar)
- Cc: dalej at apple dot com, Richard dot Earnshaw at arm dot com, aph at redhat dot com, echristo at redhat dot com, gcc at gcc dot gnu dot org
- Date: Thu, 13 Mar 2003 19:11:13 -0800
- Subject: Re: -fobey-inline (was Re: gcc and inlining)
On Thursday, Mar 13, 2003, at 19:00 US/Pacific, Robert Dewar wrote:
#include <setjmp.h>
static jmp_buf buf;
inline void x() { setjmp(buf); }
main() { x(); longjmp(buf); }
I don't know the C standard well enough in my head to be sure, but I
would be
*amazed* if this is a semantically valid C program. It can't be right
to "wake up"
an expired scope with a longjmp, can it? Of course one can be
surprised when it
comes to C :-)
Yes, I also suspect that the semantics of the foregoing are undefined
to begin with. :-)
Besides, won't the compiler simply refuse to inline x() no matter how
hard you beg it to,
because of the setjmp() call?
--Zem
--------------------------------------------------------------
Ziemowit Laski 1 Infinite Loop, MS 301-2K
Mac OS X Compiler Group Cupertino, CA USA 95014-2083
Apple Computer, Inc. +1.408.974.6229 Fax .5477