-
I can't figure out how I'd pass a generic pointer with 2.9.0; adding an explicit cast to (char *) generates precisely the same code as without the cast; it's the cast type conversion code which is broken precisely in this case, after all (ask for RESULT_TYPE_NONE and you'll never get a generic pointer).
With 2.8.0 (or 2.9.0 with my patch), you can ask the code to pass a short pointer with an...
2009-04-30 02:24:30 UTC in Small Device C Compiler
-
On 28 Dec 2008, Maarten Brock added RESULT_TYPE_GPTR as a distinct case from RESULT_TYPE_NONE, but it looks like that didn't include changes to make the varargs parameter passing code use RESULT_TYPE_GPTR in cases that involved passing pointers. I've attached a patch which passes RESULT_TYPE_GPTR for the two pointer cases in the varargs parameter type computation.
2009-04-29 15:14:48 UTC in Small Device C Compiler
-
When a varags function (like printf) is passed a non-generic pointer (__code char *, for instance), that argument is not promoted to a generic pointer when pushed on the stack. This is a change from the 2.8 version which did this promotion.
The test is small enough to include in-line here:
extern void f(char *x, ...);
void
func(__code char *s)
{
f("hi", s);
}
SDCC...
2009-04-28 18:21:44 UTC in Small Device C Compiler