kerneis / cpc

Continuation Passing C
http://www.pps.univ-paris-diderot.fr/~kerneis/software/cpc
Other
112 stars 13 forks source link

missing declaration for static assignment #3

Closed boutier closed 11 years ago

boutier commented 12 years ago

static assignment is bugged.

The following code will produce: file.cpc:48:3: error: 'bugged_pointer___0' undeclared (first use in this function)

include <cpc/cpc_runtime.h>

include <cpc/cpc_io.h>

static void *bugged_pointer;

cps void* get_pointer(void) { return NULL; }

cps void big_bug(void) { bugged_pointer = get_pointer(); }

int main(int argc, char **argv) { cpc_spawn big_bug(); cpc_main_loop(); return 0; }

kerneis commented 12 years ago

You need to learn how to quote source code on github (with markdown), but I see what the issue is. I'll complete the preliminary pass that adds temporary variables to handle that case to: x = f(); would become tmp = f(); x = tmp;