} else {
/* why not using a function pointer ? */
f = &fact;
- print_num((*(long (*)())f)(n), base);
+ print_num((*(long (*)(int))f)(n), base);
}
printf("\n");
return 0;
all: $(TESTS)
+# cq71.c and cq84.c have "K & R"-style syntax. And, some local forward
+# function-declarations don't match the later global function definitions.
+# Those programs fail when fastcall is used; but, the cdecl calling convention
+# tolerates those conflicts. Therefore, make their functions default to cdecl.
+#
+$(WORKDIR)/cq71%prg $(WORKDIR)/cq84%prg: CC65FLAGS += -Wc --all-cdecl
+
$(WORKDIR)/%.prg: %.c
$(CL65) $(CC65FLAGS) $< -o $@
$(SIM65) $(SIM65FLAGS) $@