Community
cancel
Showing results for 
Search instead for 
Did you mean: 
ZES
Beginner
72 Views

Incorrect warning for NAN, HUGE_VALF: "Floating-point operation result is out of range"

We try to compile this testcase:

#include <math.h>

int main() {
   float f1 = HUGE_VALF;
   decltype(HUGE_VALF) *f2 = &f1;
}

And get the following result

>icl samplelimits.cc
Intel(R) C++ Intel(R) 64 Compiler for applications running on IA-32, Version 16.
0 Build 20151021
Copyright (C) 1985-2015 Intel Corporation.  All rights reserved.

samplelimits.cc
samplelimits.cc(4): warning #265: floating-point operation result is out of rang
e
     float f1 = HUGE_VALF;
                ^

Microsoft (R) Incremental Linker Version 14.00.23506.0
Copyright (C) Microsoft Corporation.  All rights reserved.

-out:samplelimits.exe
samplelimits.obj

>

Judging from the error-message and the succeeding "decltype", HUGE_VALF has type float, but still, intel reports that "floating-point operand result is out of range". Same happens for NAN (with which it complains *twice* for the same line of code).

We use MSVC2015 Update 1 and the intel compiler version as specified in the output above.

0 Kudos
5 Replies
ZES
Beginner
72 Views

The consequence is that we get lots of warnings from <limits>, because in order to work-around https://software.intel.com/en-us/articles/limits1120-error-identifier-builtin-nanf-is-undefined , we needed to add macro-definitions for those builtin functions. This is very annoying.

Bernard
Black Belt
72 Views

Probably because HUGE_VALF is used to indicate overflow in type float and you are using it to initialize variable "f1" so compiler "thinks" that you will use this value as an argument in some computation.

 

Melanie_B_Intel
Employee
72 Views

Thanks for this report. I created DPD200380653 in our internal bugs database to track the issue.

You can suppress the warning message using the icl option -wd265

Kittur_G_Intel
Employee
72 Views

Thx Melanie, I"ll monitor the issue and update the post when the release with the fix is out - appreciate much.
_KIttur

Kittur_G_Intel
Employee
72 Views

@Zes:
Hi,  Just letting you know that this issue is fixed in the latest 16.0 update 2 release which you can download and test it out. Thanks for bringing this issue to our attention and patience through this issue as well.
_Kittur