This is the mail archive of the cygwin mailing list for the Cygwin project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
/* This small program causes a libgc error when compiled and run in Cygwin:
#include <gc/gc.h> #include <stdio.h>
void f (void (*x)()) { x(); }
int main () { int i;
void g () { printf("%i\n", i); }
i = 42; f(g); dummy = GC_MALLOC(10);
return 0; }
/* The presence of a function call that is passed a pointer to a Gnu C nested function with a closure seems to cause the problem:
- i is global; - i is not used in g; - g is called normally (not passed to f); - f is not called; - GC_MALLOC is not called; - GC_MALLOC is replaced with malloc.
- f does not call g; - GC_MALLOC is called before f.
Attachment:
cygcheck.out
Description: Text document
-- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |