KhronosGroup / KTX-Software

KTX (Khronos Texture) Library and Tools
Other
864 stars 226 forks source link

Remove unused variable 's' and 'e' in ktxUpgrader::main #743

Closed FuXiii closed 1 year ago

FuXiii commented 1 year ago

When use MinGW to compile, it will output error:

E:\TestDelete\WebAssemblyTest\KTX-Software\tools\ktx2ktx2\ktx2ktx2.cpp:190:47: error: unused variable '
    std::vector<_tstring>::const_iterator it, s, e;
                                              ^
E:\TestDelete\WebAssemblyTest\KTX-Software\tools\ktx2ktx2\ktx2ktx2.cpp:190:50: error: unused variable '
    std::vector<_tstring>::const_iterator it, s, e;
                                                 ^

then remove unused variable s and e. It will compile succes.

FuXiii commented 1 year ago

If I set CMAKE_CXX_FLAGS with -Wno-unused-variable it will compile success. 😂 This shouldn't be a problem, at most it can be considered compiler option settings.

MarkCallow commented 1 year ago

Thanks for this. The warning is new in the GCC version in your MinGW. It also appears with the latest Xcode/Clang. I intend to fix this warning as you did and also create a CMake config option for turning on warnings as errors which we will set in CI but disable by default so most people will not have to deal with new warnings in the future. I'll provide a different PR in a few days.