contiki-os/contiki — pull request #873 by marcas756 (2014-11-22 14:02:10+00:00)
Title: MSP430/IAR-C : Fix Warning “transfer of control bypasses initialization of PT_YIELD_FLAG"

This pull request replaces #798

Cleaned up the pull request.

IAR-C compiler throws this warning in case of following and often used example

PROCESS_THREAD(test_process, ev, data)
{
PROCESS_EXITHANDLER(goto exit);

PROCESS_BEGIN();

....
exit:
doSomething();

PROCESS_END();
}

as in case of "goto exit" , PROCESS_BEGIN() gets bypassed.

Following changes were made:

Added LC_SET_YIELD(lc,retval) to switch and addrlabels version of lc
Modified PT_BEGIN,PT_END,PT_YIELD and PT_YIELD_UNTIL to work with LC_SET_YIELD

This change makes the PT_YIELD_FLAG unnecessary, but delivers the same behaviour and might be more efficient than the PT_YIELD_FLAG version.

The 6502 uses its own optimized version for local continuations.
So I added the PT_YIELD_FLAG (LC_YIELD_FLAG in this case) to lc.h of the 6502 implementation.
Maybe someone else can write an optimized version of LC_SET_YIELD for 6502?
In case of 6502 the code execution time for the LC_YIELD_FLAG version should be nearly the same as for PT_YIELD_FLAG version.