This is the mail archive of the gcc@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]
Other format: [Raw text]

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


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