Error: wrong number of arguments in function call for typedef's in structures
Using the sample file, I get the error:
Error: coroutine-cpc.c:10: wrong number of arguments in function call: *(s->f)
Fatal error: exception Errormsg.Error
I think this is due to the assertion at line 1839 in src/ext/cpc.ml failing, however I was unable to debug it further. Hopefully this is a pretty minimal testcase.
Attachment is at http://codepad.org/K4ETqqP7
Copy/pasting regression case for future reference:
typedef void __attribute__((cps)) CoroutineEntry(void *opaque);
struct st {
CoroutineEntry *f;
void *n;
};
void __attribute__((cps)) g(struct st *s)
{
s->f(s->n);
}
Thanks for the report. I suspect this might be because I do not unroll the typedef at some point (or even more likely, since it only occurs with structure fields, that I don't perform a "deep unrolling"). Should hopefully be easy to fix.
Weird: replacing s->f(s->n) by s->f(NULL) removes the error. No idea why (probably some implicit cast being added by CIL), but it explains why my previous tests missed that case.
I'm still seeing this issue:
Error: /home/cs648/qemu/savevm.c:697: wrong number of arguments in function call: *((f->ops)->get_buffer)
savevm.c: http://codepad.org/N2JuwluQ savevm.i: http://codepad.org/CNEJp1YH
On Thu, Sep 05, 2013 at 04:35:08PM -0700, Charlie Shepherd wrote:
I'm still seeing this issue:
Error: /home/cs648/qemu/savevm.c:697: wrong number of arguments in function call: *((f->ops)->get_buffer)
Maybe we need unrollTypeDeep instead of unrollType.
savevm.c: http://codepad.org/N2JuwluQ savevm.i: http://codepad.org/CNEJp1YH
But I cannot test because codepad.org truncates your files!