UPGRADE YOUR BROWSER

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?

Description

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
日期 04/25/2009
状态 Active
Type 综合文章