- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Trying to compile gzip,
But I keep getting,
isnan.c(132): error: floating-point operation result is out of range
static memory_double nan = { L_(0.0) / L_(0.0) };
^
isnan.c(133): error: floating-point operation result is out of range
static DOUBLE plus_inf = L_(1.0) / L_(0.0);
This maybe a bug with the icc compiler.
But I keep getting,
isnan.c(132): error: floating-point operation result is out of range
static memory_double nan = { L_(0.0) / L_(0.0) };
^
isnan.c(133): error: floating-point operation result is out of range
static DOUBLE plus_inf = L_(1.0) / L_(0.0);
This maybe a bug with the icc compiler.
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yes, this looks to be a bug with icc. Below is a small test-case:--
This gives errors with icc, while gcc builds fine.
I am going to escalate to the developer, and will let you know the progress.
Regards
Milind
[bash]#include#include static long double nan = { 0.0L / 0.0L }; static long double plus_in = 1.0L / 0.0L; static long double minus_in = -1.0L / 0.0L; int main() { return 1; } [/bash]
This gives errors with icc, while gcc builds fine.
I am going to escalate to the developer, and will let you know the progress.
Regards
Milind
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Record number for issue is: DPD200155372.
I see that using
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I got a reply from developer:--
The situation described (i.e. that the compiler works differently between C and C++) is not a bug. It reflects the fact that run-time initialization of static objects is allowed in C++, but not in C. However, what is a bug is the fact that we reject it while GCC accepts it without a quiver, even in C.
It shouldn't be hard to drop divide-by-zero from the list of floating-point errors. The interesting question is whether that would have any side effects.
Also, I tried the following program which works interestingly, with non-static non-global variables:--
[bash]#includeint main() { long double nan = { 0.0L / 0.0L }; long double plus_in = 1.0L / 0.0L; long double minus_in = -1.0L / 0.0L; return 1; } [/bash]
Though I am in touch with the developer to correct the bug, which is not reported in gcc.

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