*
*Home|Chinese|Japanese*About ARM|Forums|Events|News|Employment|Contact Us|Investors*
dotted rule
*ARM - the architecture for the digital worldARM - the architecture for the digital world
search
*
*
***
*MARKETS:PRODUCTS & SOLUTIONS:CONNECTED COMMUNITY:TECHNICAL SUPPORT:DOCUMENTATION*
*
technical support
*
*
****
*.Technical Support
*
*
*>>Home Page*
*
*.Obtaining Support*
*
*.FAQs*
*
**Development Tool FAQs*
**IP FAQs*
**Embedded Software FAQs*
**Artisan Physical IP FAQs (Login Required)*
*
*.Downloads*
*
*.Documentation*
*
*.Training*
*
*.Where To Buy*
*
*.Keil MCU Tools*
*
*.What's New*
*
*.ARM Newsgroups*
*
*.Active Assist On-site Services*
*
*
*
technical support FAQsask ARM*
*

Technical Support Search
*     (Advanced Search)
  FAQs   Documentation   Downloads   Forums

*

 
downarrowProblems with sprintf, when printing doubles or long longs
Applies to: Compilers, Libraries, RealView Developer Suite (RVDS) 2.0, RealView Developer Suite (RVDS) 2.1, RealView Developer Suite (RVDS) 2.2, RealView Development Suite (RVDS) 3.0, RealView Development Suite (RVDS) 3.1

If you are encountering problems when printing double or long long using sprintf  it is often caused by one of three issues. We recommend that you check:

  1. Your code (including an OS if you are using one) maintains 8-byte stack alignment at all its external public interfaces as required by the ABI and checked by the linker. If not, please contact your OS vendor.

  2. The ARM-supplied libraries are being initialised correctly.

    Does your software have a main()? If so, main() will call __rt_entry -> __rt_lib_init. If do not have a main(), you need to ensure that the library init code is called correctly.

    There are recommendations in chapter 5 of the RVCT Compiler and Libraries guide. This chapter explains how you can initialize specific parts of the C-library as needed (e.g. the locale), rather than all of it via __rt_entry. How to set the locale is detailed in the FAQ "C library character and string function problems" which can be found at:

    http://www.arm.com/support/faqdev/1217.html

  3. The __user_libspace static data area (a block of 96 bytes in the ZI segment which holds the static data for the C libraries,  such as the locale settings) is being set up correctly, and is not being accidentally overwritten at runtime. You can check this by opening a memory window over these areas using a debugger, and check that it is not corrupted.





back to top

*
**
*4 dots*Other ARM Websites
*
shadow *LEGAL STATEMENTshadow