Am 13.04.22 um 03:18 schrieb David Tulloh via Sdcc-user:
I noticed this in the documentation, http://sdcc.sourceforge.net/doc/sdccman.pdf 4.6.9 Known Bugs 4.6.9.1 Function arguments Functions with variable argument lists (like printf) are not yet supported. However vsprintf seems to be provided and used in the code base, the changelog includes a number of notes around those functions.
AFAIK, that section 4.6.9 has been outdated for more than 20 years. I'll remove it later this week (unless someone else does so first). The only currently known bugs are the one on the bug tracker at SourceForge.
What are the known issues with variable argument lists? Are there any known issues which would cause _printf_format to overflow like this?
Known issues are that they are not supported for some foreign calling conventions (at least __smallc, would have to check for __iar, __cosmic and __raisonance). Minor issues are about efficiency (arguments always passed on the stack, never in registers, calls are never inlined).
Since variable arguments are always passed on the stack, I suspect a stack overflow, depending on how much memory you have and how you use it.
But of course this could be an entirely different bug, either in your code or in SDCC. The manual has a section on known bugs, and we have the tracker, but of course there will be unknown bugs hiding somewhere (though we do have a large set of regression tests that includes most tests from GCC; in terms of correctness, SDCC today is much better than 10 or 20 years ago).
Philipp _______________________________________________ Sdcc-user mailing list Sdcc-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sdcc-user