Mercurial > hg > CbC > CbC_gcc
view CbC-examples/test_func2code.c @ 81:dbfc0d2dde36
minor fix
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 24 Sep 2011 02:43:04 +0900 |
parents | 959d4c8c8abc |
children |
line wrap: on
line source
#include<stdio.h> #include<stdlib.h> #define DEBUG 1 #ifdef DEBUG #define log(f, args...) \ fprintf(stderr, "in %s: "f, __FUNCTION__, ## args) #else #define log(f, args...) ; #endif __code exitter(int a) { exit(0); } __code cs0(int x, int y) { log("x = %d, y = %d.\n", x, y); log("will exit with code %d.\n", x*y); goto exitter(x*y); } void continuation(int a) { log("go code segment cs0\n"); goto cs0(a, a*20); log("Error: continuation reachs bad region.\n"); } int main(int argc, char **argv) { int a; if (argc>2) { a = atoi(argv[1]); } continuation(20); }