- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm using Intel C++ 10.1.014 (IA-32) with VS2005 trying to compile the following code:
const float twoTo23 = 0x1.0p23f;
What I get is 'error: expected a ";"' on that line. I've tried many variations (non-hex works fine) and a few compiler switches(/Qstd=c99, /Qstd=c++0x, /Qc99) with the same results. I've verified that the compiler output is from Intel (not MSVC) and have looked at other switches.
The file being compiled ends with .cxx and includes a .h file with the above code in it, if that helps. According to an old post in this forum, and in the Intel compiler specs, hex floating-point constants are supposed to be supported. Am I missing a switch or some other details? Please help.
Thanksall,
-Allen
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
c99 isn't compatible with C++, which is set by the .cxx suffix.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
So, are you saying that hex floating-point constants are not supported in C++ files compiled by icc (with or without /Qstd=c++0x), but only in c99 .c files?
If so, that might make sense why I can't get it to compile; however, it would kind of put a damper in my day. The source code I am trying to compile works in XCode, Linux gcc, and Borland (although, not MSVC).
If so, that might make sense why I can't get it to compile; however, it would kind of put a damper in my day. The source code I am trying to compile works in XCode, Linux gcc, and Borland (although, not MSVC).
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page