Mercurial > hg > CbC > CbC_gcc
view CbC-examples/test_nest.c @ 81:dbfc0d2dde36
minor fix
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 24 Sep 2011 02:43:04 +0900 |
parents | 4c6926a2b9bc |
children |
line wrap: on
line source
int printf(char *, ...); typedef void (*RET_FUNC)(int, void *); void g(RET_FUNC func) { func(33, 0); } int f() { void *ret; ret = ({ __label__ exit0; int retval; void __return_func(int retval_, void *fp){ retval = retval_; goto exit0; } if (0) { exit0: printf("f2: fp = 0x%x\n", __builtin_frame_address(0)); return retval; } __return_func; }); //g(__return_func, __builtin_frame_address(0)); printf("f0: fp = 0x%x\n", __builtin_frame_address(0)); printf("__return_func = %x\n", ret); g(ret); printf("not good\n"); return 0; //exit0: //printf("f2: fp = 0x%x\n", __builtin_frame_address(0)); //return retval; } int main(int argc, char **argv) { int t; printf("main before: fp = 0x%x\n", __builtin_frame_address(0)); t = f(); printf("f = %d\n", t); printf("main after: fp = 0x%x\n", __builtin_frame_address(0)); }