Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7953 Discussions

Intel 64 mode: __STDC_DEC_FP__ defined, but _Decimal32 not known

tydeman
Beginner
623 Views
Hardware: Centrino 2 vPro (Core2Duo) in 64-bit mode
O.S.: Linux Fedora Core 10 in 64-bit mode
Compiler: Intel icc 11.1, 072 in Intel64 mode
Command line options: "-std=c99 -msse3 -O0 -fmath-errno -fp-model strict -fp-speculation=strict -H ${INCS}"

The Intel compiler icc 11.1 (in C99 mode) defines __STDC_DEC_FP__,
telling the user that decimal floating-point (DFP) is supported. Yet,
if you try to use DFP, the compiler complains about unknown types.

Program:

#define __STDC_WANT_DEC_FP__ 1 /* Tell compiler we want DFP */

#ifdef __STDC_DEC_FP__ /* Does compiler support DFP? */
_Decimal32 x;
#else
#error No support for DFP
#endif
0 Kudos
8 Replies
Milind_Kulkarni__Int
New Contributor II
623 Views

Hello,

I think this issue was already raised by you in June month. The threadid in the forum is:-- 75585, and it looks same . Could you verify so that we do not duplicate the bug in the record. It also has to do with -std=c99 disabling the use of _Decimal FP types. Well, it works without the c99 option, but should work with that too, being a part of ISO C standard.

That issue is already escalated to developer team by the engineer. Please let me know.

0 Kudos
tydeman
Beginner
623 Views
75585 has to do with IA-32 mode. This is with Intel 64 mode.

75585 has to do with not working after the user did
#define __STDC_WANT_DEC_FP__

This has to do with __STDC_DEC_FP__ being defined by the
compiler, yet _Decimal32 not being usable.
0 Kudos
Milind_Kulkarni__Int
New Contributor II
623 Views
I have escalated it as a bug (here c99 corrupts Decimal FP usage).
I will keep you updated on the progress..
0 Kudos
Judith_W_Intel
Employee
623 Views

A macro doesn't turn on a feature, it indicates whether or not the feature is available on a particular platform. It should be used to check availability, not set it.
0 Kudos
tydeman
Beginner
623 Views
The compiler is defining __STDC_DEC_FP__
My program is testing that symbol.
So, I do not understand your comment.
0 Kudos
Judith_W_Intel
Employee
623 Views

I'm sorry, I misread the first line of your program:

#define __STDC_WANT_DEC_FP__ 1 /* Tell compiler we want DFP */

I thought this said __STDC_DEC_FP not __STDC_WANT_DEC_FP__.

Anyway, I understand your point now that if the compiler's not going to accept the DFPkeywords
it shouldn't define the macro. I agree.

This is entered as cq # DPD200159716.

Sorry for the confusion.

Judy
0 Kudos
Milind_Kulkarni__Int
New Contributor II
623 Views
This issue is fixed in latest compiler of 12.0.
For compatibility with GNU, we do not, and will not, recognize DFP types when -std=c99 is used.

Now, the __STDC_DEC_FP does not get defined, and the appropriate assertion comes.
0 Kudos
tydeman
Beginner
623 Views
Since Decimal Floating-Point (DFP) is an extension built on top of C99, how do I get both C99 and DFP?
0 Kudos
Reply