Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
wants to merge 1 commit into from

Conversation

FuXiii
Copy link
Contributor

@FuXiii FuXiii commented Jul 22, 2023

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 FuXiii changed the title Remove unused variable 's' and 'e' in ktxUpgrader::main(int argc, _TC… Remove unused variable 's' and 'e' in ktxUpgrader::main Jul 22, 2023
@FuXiii
Copy link
Contributor Author

FuXiii commented Jul 25, 2023

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.

@FuXiii FuXiii closed this Jul 25, 2023
@MarkCallow MarkCallow reopened this Jul 25, 2023
@MarkCallow MarkCallow closed this Jul 25, 2023
@MarkCallow
Copy link
Collaborator

MarkCallow commented Jul 25, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants