[Scummvm-devel] PROPOSAL: Removing (f)printf usage

Max Horn max at quendi.de
Mon Nov 1 17:10:49 CET 2010


P.S.: Here is what the autoconf manual has to say about va_copy and how to use it portably:


va_copy
The C99 standard provides va_copy for copying va_list variables. It may be available in older environments too, though possibly as __va_copy (e.g., gcc in strict pre-C99 mode). These can be tested with #ifdef. A fallback to memcpy (&dst, &src, sizeof (va_list)) gives maximum portability. 

va_list
va_list is not necessarily just a pointer. It can be a struct (e.g., gcc on Alpha), which means NULL is not portable. Or it can be an array (e.g., gcc in some PowerPC configurations), which means as a function parameter it can be effectively call-by-reference and library routines might modify the value back in the caller (e.g., vsnprintf in the GNU C Library 2.1). 

Source: <http://www.gnu.org/software/hello/manual/autoconf/Function-Portability.html#index-g_t_0040code_007bva_005fcopy_007d-364>


Bye,
Max



More information about the Scummvm-devel mailing list