Read-only archive of the All About Symbian forum (2001–2013) · About this archive

How to force setjmp/longjmp to work ?

0 replies · 1,423 views · Started 12 September 2005

Hi!
I try to use setjmp/longjmp instructions. But application fails with KERN-EXEC 3. Code is very simple:

jmp_buf jump_buffer;

if ( setjmp( jump_buffer ) == 0 )
{
longjmp( jump_buffer, 1 );
}
return 0;

In the documentation I have found, that for support setjmp/longjmp it is necessary to use a key --apcs/rwpi (or -- apcs/norwpi) for compiler. But with this key I receive a linker error:
Error: L6238E: callfirstprocessfn.o (.text) contains invalid call from 'USESV6' function to 'RWPI' function E32Main ().
What is such?
I have found one more explanation how to force setjmp/longjmp to work here:
http://www3.symbian.com/faq.nsf/0/616A0D4BD839DB7E80256DAC007356BB?OpenDocument. But this didn't help me.
Anybody used setjmp/longjmp? Share experience, please.
Thanks.