Imagination PowerVR SDK Blog

Please fix warnings on SDK for [-Wfloat-equal]


#1

Hi



I request if you can fix float comparison warnings in the SDK since this flag is quite essential to prevent extremely strange float comparison bugs.

Given that variation will exist from platform to platform this will benefit the whole PVR SDK users community.



Here is just a short glimse of the warnings from the SDK itself. Its true I can fix it on my end, but I still insist if this can be corrected.

There are just too many warnings from the SDK and prevents easy viewing of similar warning in our code.











C:/Imagination/PowerVR/GraphicsSDK/SDK/Tools/OGLES2/…/PVRTVector.h: In member function

’bool PVRTVec2::operator==(const PVRTVec2&) const’:

C:/Imagination/PowerVR/GraphicsSDK/SDK/Tools/OGLES2/…/PVRTVector.h:256:21: warning: co

mparing floating point with == or != is unsafe [-Wfloat-equal]

C:/Imagination/PowerVR/GraphicsSDK/SDK/Tools/OGLES2/…/PVRTVector.h:256:37: warning: co

mparing floating point with == or != is unsafe [-Wfloat-equal]

C:/Imagination/PowerVR/GraphicsSDK/SDK/Tools/OGLES2/…/PVRTVector.h: In member function

’bool PVRTVec2::operator!=(const PVRTVec2&) const’:

C:/Imagination/PowerVR/GraphicsSDK/SDK/Tools/OGLES2/…/PVRTVector.h:267:21: warning: co

mparing floating point with == or != is unsafe [-Wfloat-equal]

C:/Imagination/PowerVR/GraphicsSDK/SDK/Tools/OGLES2/…/PVRTVector.h:267:37: warning: co

mparing floating point with == or != is unsafe [-Wfloat-equal]

C:/Imagination/PowerVR/GraphicsSDK/SDK/Tools/OGLES2/…/PVRTVector.h: In member function

’bool PVRTVec3::operator==(const PVRTVec3&) const’:

C:/Imagination/PowerVR/GraphicsSDK/SDK/Tools/OGLES2/…/PVRTVector.h:579:21: warning: co

mparing floating point with == or != is unsafe [-Wfloat-equal]

C:/Imagination/PowerVR/GraphicsSDK/SDK/Tools/OGLES2/…/PVRTVector.h:579:37: warning: co

mparing floating point with == or != is unsafe [-Wfloat-equal]

C:/Imagination/PowerVR/GraphicsSDK/SDK/Tools/OGLES2/…/PVRTVector.h:579:53: warning: co

mparing floating point with == or != is unsafe [-Wfloat-equal]

C:/Imagination/PowerVR/GraphicsSDK/SDK/Tools/OGLES2/…/PVRTVector.h: In member function

’bool PVRTVec3::operator!=(const PVRTVec3&) const’:

C:/Imagination/PowerVR/GraphicsSDK/SDK/Tools/OGLES2/…/PVRTVector.h:590:21: warning: co

mparing floating point with == or != is unsafe [-Wfloat-equal]

C:/Imagination/PowerVR/GraphicsSDK/SDK/Tools/OGLES2/…/PVRTVector.h:590:37: warning: co

mparing floating point with == or != is unsafe [-Wfloat-equal]

C:/Imagination/PowerVR/GraphicsSDK/SDK/Tools/OGLES2/…/PVRTVector.h:590:53: warning: co

mparing floating point with == or != is unsafe [-Wfloat-equal]

C:/Imagination/PowerVR/GraphicsSDK/SDK/Tools/OGLES2/…/PVRTVector.h: In member function

’bool PVRTVec4::operator==(const PVRTVec4&) const’:

C:/Imagination/PowerVR/GraphicsSDK/SDK/Tools/OGLES2/…/PVRTVector.h:950:20: warning: co

mparing floating point with == or != is unsafe [-Wfloat-equal]

C:/Imagination/PowerVR/GraphicsSDK/SDK/Tools/OGLES2/…/PVRTVector.h:950:36: warning: co

mparing floating point with == or != is unsafe [-Wfloat-equal]

C:/Imagination/PowerVR/GraphicsSDK/SDK/Tools/OGLES2/…/PVRTVector.h:950:52: warning: co

mparing floating point with == or != is unsafe [-Wfloat-equal]

C:/Imagination/PowerVR/GraphicsSDK/SDK/Tools/OGLES2/…/PVRTVector.h:950:68: warning: co

mparing floating point with == or != is unsafe [-Wfloat-equal]

C:/Imagination/PowerVR/GraphicsSDK/SDK/Tools/OGLES2/…/PVRTVector.h: In member function

’bool PVRTVec4::operator!=(const PVRTVec4&) const’:

C:/Imagination/PowerVR/GraphicsSDK/SDK/Tools/OGLES2/…/PVRTVector.h:961:20: warning: co

mparing floating point with == or != is unsafe [-Wfloat-equal]

C:/Imagination/PowerVR/GraphicsSDK/SDK/Tools/OGLES2/…/PVRTVector.h:961:36: warning: co

mparing floating point with == or != is unsafe [-Wfloat-equal]

C:/Imagination/PowerVR/GraphicsSDK/SDK/Tools/OGLES2/…/PVRTVector.h:961:52: warning: co

mparing floating point with == or != is unsafe [-Wfloat-equal]

C:/Imagination/PowerVR/GraphicsSDK/SDK/Tools/OGLES2/…/PVRTVector.h:961:68: warning: co

mparing floating point with == or != is unsafe [-Wfloat-equal]


#2

Hi,



Thanks for reporting this. I’ve filed it as BRN45796 in our bug tracker.



Regards,

Joe


#3

Thank you for considering the request !!