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

Fix Conversion #2782

Merged
merged 1 commit into from
Feb 22, 2022
Merged

Fix Conversion #2782

merged 1 commit into from
Feb 22, 2022

Conversation

HazardyKnusperkeks
Copy link
Contributor

With -Wconversion and 32 Bit I get a warning here with unsigned long
long converted to unsigned long.

With -Wconversion and 32 Bit I get a warning here with unsigned long
long converted to unsigned long.
@vitaut
Copy link
Contributor

vitaut commented Feb 21, 2022

Could you post the full warning and compiler flags used?

@HazardyKnusperkeks
Copy link
Contributor Author

fmt/include/fmt/format.h:1986:65: warning: conversion from 'long long unsigned int' to 'size_t' {aka 'unsigned int'} may change value [-Wconversion]
 1986 |     copy2(out, digits2(/*static_cast<std::size_t>*/(significand % 100)));

And
g++.exe -g -O0 -Wall -Wextra -Werror -m32 -pipe -fexceptions -pedantic -Wcast-qual -Wconversion -Wdangling-else -Wdouble-promotion -Wduplicated-branches -Wduplicated-cond -Wenum-compare -Wfloat-equal "-Wformat=2" -Wformat-nonliteral "-Wformat-overflow=1" -Wformat-security -Wformat-signedness "-Wformat-truncation=1" -Wlogical-op -Wmissing-format-attribute -Wmissing-noreturn -Wnull-dereference "-Wplacement-new=2" -Wshadow -Wsign-conversion "-Wsuggest-attribute=cold" -Wextra-semi -Wmismatched-tags -Wnoexcept -Wold-style-cast -Woverloaded-virtual -Wredundant-tags -Wuseless-cast -Wsuggest-override -Wzero-as-null-pointer-constant -DUNICODE -D_UNICODE -DWIN32 -DUNITS_REFERENCES -DCATCH_CONFIG_DISABLE_MATCHERS -DCATCH_CONFIG_ENABLE_ALL_STRINGMAKERS -DCATCH_CONFIG_FAST_COMPILE -DCATCH_HELPER_LIBRARY_HAS_QT_CORE -DCATCH_HELPER_LIBRARY_HAS_QT_GUI -DCATCH_HELPER_LIBRARY_HAS_QT_WIDGETS -DQT_ASCII_CAST_WARNINGS "-DQT_DISABLE_DEPRECATED_BEFORE=0x051200" -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_FROM_BYTEARRAY -DQT_NO_CAST_TO_ASCII -DQT_USE_QSTRINGBUILDER -DQT_WIDGETS_LIB -DQT_NETWORK_LIB -DQT_GUI_LIB -DFORMATTER_LIBRARY_HAS_QT_CORE -DFMT_USE_NOEXCEPT -DQT_CORE_LIB -D_GLIBCXX_ASSERTIONS -DBOOST_CONTAINER_USE_STD_EXCEPTIONS

While at it for completeness:

$ g++ --version
g++.exe (Rev8, Built by MSYS2 project) 11.2.0

@vitaut
Copy link
Contributor

vitaut commented Feb 22, 2022

I was not able to repro the warning: https://godbolt.org/z/6n586Eq91. Do you have a repro?

@vitaut
Copy link
Contributor

vitaut commented Feb 22, 2022

Nevermind, I managed to repro: https://godbolt.org/z/PnaKTf7Mx.

@vitaut vitaut merged commit 0742606 into fmtlib:master Feb 22, 2022
@vitaut
Copy link
Contributor

vitaut commented Feb 22, 2022

Merged, thanks

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.

None yet

2 participants