I am trying to compile a C99 program that uses decimal floating-point, but get errors.
Hardware: Intel Pentium 4 in IA-32 mode
O. S.: Linux: Fedora Core 10
Compiler: Intel C Compiler Pro IA-32, Version 11.1, Build 2010/04/14
Command line: icc -std=c99 -fp-model strict -O0 test.c
where test.c is these two lines:
The error I get is: .../math.h(1172): error: identifier "_Decimal32" is undefined
extern _Decimal32 acosd32(_Decimal32 x);
It appears the -std=c99 disables decimal floating-point.
Aside: Your should have at line 1171:
#if (defined __STDC_WANT_DEC_FP__) && (defined __STDC_DEC_FP__)
So, what command line options do I need to enable decimal FP, along with c99?
Our engineering team thinks that the behavior is desired in c99 mode. Decimal floating point is not part of the C99 standard (but neither are lots of other things we allow in C99 mode). I tested with gcc 4.5. See below.
Our developer posted an update regarding this feature request:
It is expected that the Decimal Floating-Point types in C++ would be implemented via C++ classes (header and library). The C++ standard docs have been proposed by IBM and arehttp://open-std.org/JTC1/SC22/WG21/docs/papers/2008/n2732.pdf
------end of update-----
I'll let you know when I have more updates.
Engineering team has implemented this for 13.0 compiler. I'll let you know when 13.0 compiler that contains DFP support for C++ is available for download.