As the docs say, GCC does not provide I / O because printf , etc. provided by libc not gcc.
IBM has provided an extension for the GNU C library, libdfp, which adds printf hooks for decimal I / O. I have not used it, but you can get the code from the eglibc svn repository and create it yourself:
svn co http://www.eglibc.org/svn/libdfp/trunk libdfp
A web search shows that Ubuntu packages are like libdfp , and it can also be accessed on RHEL6.
README says:
When libdfp is loaded printf will recognize the following length modifiers: %H - for _Decimal32 %D - for _Decimal64 %DD - for _Decimal128 It will recognize the following conversion specifier 'spec' characters: e,E f,F g,G a,A (as debuted in ISO/IEC TR 24732) Therefore, any combination of DFP length modifiers and spec characters is supported.
source share