intel / gmmlib

Other
158 stars 86 forks source link

ULT TEST_BPP warning #83

Closed edwarddavidbaker closed 3 years ago

edwarddavidbaker commented 3 years ago

Hi, When building 20.4.1 on Chrome OS the following warnings are observed.

Source/GmmLib/ULT/GmmGen12dGPUResourceULT.cpp:2122:57: warning: result of comparison of constant 8 with expression of type 'TEST_BPP' (aka 'TEST_BPP_ENUM') is always true [-Wtautological-constant-out-of-range-compare]
        gmmParams.Flags.Info.AllowVirtualPadding = (bpp != 8); //OCL uses 8bpp buffers. Specification doesn't comment if Linear buffer compr allowed or not on bpp!=8.
                                                    ~~~ ^  ~
Source/GmmLib/ULT/GmmGen12dGPUResourceULT.cpp:2167:57: warning: result of comparison of constant 8 with expression of type 'TEST_BPP' (aka 'TEST_BPP_ENUM') is always true [-Wtautological-constant-out-of-range-compare]
        gmmParams.Flags.Info.AllowVirtualPadding = (bpp != 8); //OCL uses 8bpp buffers. Specification doesn't comment if Linear buffer compr allowed or not on bpp!=8.
                                                    ~~~ ^  ~
2 warnings generated.
Source/GmmLib/ULT/GmmGen12ResourceULT.cpp:2117:57: warning: result of comparison of constant 8 with expression of type 'TEST_BPP' (aka 'TEST_BPP_ENUM') is always true [-Wtautological-constant-out-of-range-compare]
        gmmParams.Flags.Info.AllowVirtualPadding = (bpp != 8); //OCL uses 8bpp buffers. doc doesn't comment if Linear buffer compr allowed or not on bpp!=8.
                                                    ~~~ ^  ~
Source/GmmLib/ULT/GmmGen12ResourceULT.cpp:2162:57: warning: result of comparison of constant 8 with expression of type 'TEST_BPP' (aka 'TEST_BPP_ENUM') is always true [-Wtautological-constant-out-of-range-compare]
        gmmParams.Flags.Info.AllowVirtualPadding = (bpp != 8); //OCL uses 8bpp buffers. document doesn't comment if Linear buffer compr allowed or not on bpp!=8.
                                                    ~~~ ^  ~
2 warnings generated.

Fixture TestLinearCompressedResource is looping through TEST_BPP values (0, 1, 2, 3, 4). Comparing to 8 is outside of the available enum options.

johnmach commented 3 years ago

Resolved in https://github.com/intel/gmmlib/commit/50505ec3710059835f538b57a70ade713b3bf848 Hence Closing this issue.