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, March 13, 2003, at 07:00 PM, 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 :-)

Ah, but if the inline is performed it's not an expired scope any more. One of
the early C++ suites did exactly this, expecting the inline to be performed.



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