-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
GCC warnings if [-Wshadow] is enabled. #770
Comments
I assume you're only including <core.h>, because Lines 54 to 65 in 1b8a7f8
|
No. #define FMT_HEADER_ONLY
#include "fmt/format.h"
int main() {
std::string ss = "string";
fmt::format("{} \n", ss);
return 0;
} |
Can't reproduce in CE: https://godbolt.org/g/gqstpW |
GCC 7.3 from here https://nuwen.net/mingw.html g++ -std=c++1z -pipe -Wall -Wextra -Wshadow -Wreturn-type -fconcepts -fstrong-eval-order -faligned-new -march=native {fmt} is 1b8a7f8 commit. |
I think this might be an issue with MinGW rather than fmt, as I still can't reproduce with gcc 7.3 and with the same compiler flags: https://godbolt.org/g/tnNB8T Does anyone have gcc 7.3 installed locally so they can verify? What values are |
So test AS it described here https://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html. If I change this test to |
You're correct, that comparison is incorrect. The proper expression would be |
Fixed in 47268ec. |
There are still shadow warnings in e37d6a9 with GCC 8.2 In file included from /home/florin/work/geometry/external/lib/fmt/src/format.cc:8: |
AFAICS shadowing warnings are suppressed. |
/usr/bin/g++ -I/home/florin/work/geometry/external/lib/fmt/include -Wall -Wextra -Werror -pedantic -Wconversion -Wunused -Wshadow -g -std=c++17 -MD -MT external/lib/fmt/CMakeFiles/fmt.dir/src/format.cc.o -MF external/lib/fmt/CMakeFiles/fmt.dir/src/format.cc.o.d -o external/lib/fmt/CMakeFiles/fmt.dir/src/format.cc.o -c /home/florin/work/geometry/external/lib/fmt/src/format.cc Will produce the warnings above, with GCC 8.2 |
I see, the suppression doesn't apply in that case. Should be fixed in fa1d4db. |
Confirmed. Thank you! |
The text was updated successfully, but these errors were encountered: