Sergey Khorev wrote:
Hi:Finally I've figured out the main showstopper to get Chicken compiled by Watcom (at least at the moment). To be precise, chicken.exe and chicken-static.exe can be compiled but they don't work :) I moved my computer away from the internet, fired up ol win98 and tried your program. As expected, it compiled ok and printed garbage. Next I removed the cast from the function pointer proc3 p = (proc3)proc; // (proc3) cast hides errorNow the problem is exposed:- cd C:\bins\wtest wmake -f C:\bins\wtest\v1.mk -h -e wcc386 var.c -i=C:\watcom\h;C:\watcom\h\nt -w4 -e25 -zq -od -d2 -6r -bt=nt -mf var.c(14): Warning! W102: Type mismatch (warning) var.c(14): Note! N2003: source conversion type is 'void (*)(int __p1,int __p2,int __p3,... )' var.c(14): Note! N2004: target conversion type is 'void (*)(int __p1,int __p2,int __p3)' wlink name v1 d all SYS nt op m op maxe=25 op q op symf @v1.lk1 Execution complete The solution is the to have the function pointer typedef match the declaration of the pointed to function which has ellipses. typedef void (*proc3)(int a1, int a2, int a3, ...); // added 'dots' to match function Depending upon design of the source, it might be better to include <stdarg.h> which has _va_list and so on. Note that watcom provides examples of a function that iterates through variable parameters. It is at least instructive if not useful here. Hope this helps, -BobMc- |
_______________________________________________ Chicken-users mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/chicken-users
