We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

AR# 19592

11.1 EDK - Why does the standard C printf() function use so much memory?


Keywords: stdio.h

Why does the standard C printf() function use so much memory? For example, including a reference to printf() in a MicroBlaze program increases the size of the "Hello World" program (included in the example designs) by 51,788 bytes.


The table below summarizes the various print-related commands that you can use and how much code and data space they use over a non-printing implementation to print "hello world".

Function Size Limitations
-------------- ------- ------------------
printf() 51788 None, full featured
iprintf() 18294 No floating point, reentrant
xil_printf() 2953 No floating point, not reentrant(single thread only), no longlong(64 bit)
putnum() 284 Integer to HEX only, no other formats
print() 185 No numbers output, just strings

All of these functions can be prototyped by including <stdio.h>.

AR# 19592
Date Created 09/03/2007
Last Updated 04/25/2009
Status Active
Type General Article