printf() implementation comparison

This page is a rough comparison between various printf() implementaions. Not all printf() implementations are equal, while almost all will do the 'd', 'ld', 'u', 'lu', and 's' convertions ... even just adding a precision to one of the int formatters might not do the right thing.

Note that if you want a portable version of printf() in your code, you are much better off using something that natively parses the format string. This ensures that you get the same parsing behaviour on all platforms. Otherwise you are just waiting for your code to be run on some weird platform, and crash or possibly have a security problem. Note that this page gives information about what you should look for in a string library printf implementation, and the problems with just using the implementations sprintf()/snprintf() calls.

For a comparison of string libraries, some of which include a portable printf() like function, you should look at this page

Any corrections or omissions you see in the above, feel free to contact me at the address below


James Antill
Last modified: Mon Dec 15 03:15:37 EST 2003