Hi SDCC, I have some code running on a 8051 processor compiled with SDCC 3.5.0 and the --model-medium memory flag.
The code contains a global variable, session, which is occasionally being overwritten. The memory map suggests this is coming from a call to vsprintf. We call this from a custom variable argument wrapper function, similar to the standard printf implementation. D: 0000F086 _vsprintf_PARM_2 sprintf D: 0000F089 _vsprintf_PARM_3 sprintf D: 0000F08D __mullong_PARM_2 _mullong D: 0000F0A5 __print_format_PARM_2 printf_large D: 0000F0A8 __print_format_PARM_3 printf_large D: 0000F0AB __print_format_PARM_4 printf_large D: 0000F0B4 _session crypto 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. What are the known issues with variable argument lists? Are there any known issues which would cause _printf_format to overflow like this? I'm still experimenting to try and isolate the cause, including upgrading the SDCC version. However any guidance as I dance the intermittent waltz would be greatly appreciated. David _______________________________________________ Sdcc-user mailing list Sdcc-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sdcc-user