----- Ursprüngliche Nachricht ----- Von: Sergio Campamá Gesendet am: 14 Nov 2011 22:51:21
>void myprintf(char *fmt,...) >{ > char *p = fmt; > va_list argp; > putchar(*p); > va_start(argp, fmt); > va_end(argp); >} >It should print the first character of the string fmt. When I remove the 3 >dots in the function definition, it correctly prints it, but when running >it like shown, it does nothing. Is there something I'm missing here? I remember a bug in 3x mspgcc that happened when a function with variable parameter length (or actually any function with parameters on stack) did have local variables, and compiler optimization was on. then the compiler messed-up the stack frame, ending up with accessing the wrong stack locations for passed and local parameters. Not using local variables or disablign optimization resulted in correct code. Maybe your problem is related to the same. (btw, why don't you just use putchar(*fmt)?) JMGross ------------------------------------------------------------------------------ All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-novd2d _______________________________________________ Mspgcc-users mailing list Mspgcc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mspgcc-users