view sources/cbcreturn.cbc @ 7:8ef81ff8cb52

emended.
author kent <kent@cr.ie.u-ryukyu.ac.jp>
date Fri, 12 Feb 2010 13:10:57 +0900
parents d2999e94b97d
children
line wrap: on
line source

code cs(code (*ret)(int))
{
    goto ret(2);
}

int funcB()
{
    code (*ret)(int);
    ret = __return;
    /* do something.  */
    goto cs(ret);

    /* never reached.  */
    return -1;
}

void funcA()
{
    int t;

    t = funcB();

    printf("t=%d\n", t);
    /* t should not be -1 but 2.  */
}