C99 printf plus other portability stuff