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

Ignore clang -Wliteral-range warning #2779

Merged
merged 1 commit into from
Feb 19, 2022

Conversation

phprus
Copy link
Contributor

@phprus phprus commented Feb 19, 2022

Fix for build error on Apple M1 Max (XCode 13):

[ 31%] Building CXX object test/CMakeFiles/format-test.dir/format-test.cc.o
cd /Users/phprus/Devel/fmt/build/cxx20/test && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -DGTEST_HAS_STD_WSTRING=1 -D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING=1 -I/Users/phprus/Devel/fmt/include -isystem /Users/phprus/Devel/fmt/test/gtest/. -O2 -g -DNDEBUG -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk -fvisibility=hidden -fvisibility-inlines-hidden -Wall -Wextra -pedantic -Wconversion -Wundef -Wdeprecated -Wweak-vtables -Wshadow -Wno-gnu-zero-variadic-macro-arguments -Wzero-as-null-pointer-constant -Werror -fno-delete-null-pointer-checks -std=gnu++2a -MD -MT test/CMakeFiles/format-test.dir/format-test.cc.o -MF CMakeFiles/format-test.dir/format-test.cc.o.d -o CMakeFiles/format-test.dir/format-test.cc.o -c /Users/phprus/Devel/fmt/test/format-test.cc
/Users/phprus/Devel/fmt/test/format-test.cc:951:13: error: magnitude of floating-point constant too small for type 'long double'; minimum is 4.9406564584124654E-324 [-Werror,-Wliteral-range]
  auto ld = 8.43821965335442234493E-4933L;
            ^
1 error generated.

Copy link
Contributor

@vitaut vitaut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR.

test/format-test.cc Outdated Show resolved Hide resolved
@phprus phprus force-pushed the warning-literal-range branch 2 times, most recently from 64bd2a0 to 9cc694c Compare February 19, 2022 17:22
test/format-test.cc Outdated Show resolved Hide resolved
@phprus
Copy link
Contributor Author

phprus commented Feb 19, 2022

@vitaut , done

@vitaut vitaut merged commit ea3d326 into fmtlib:master Feb 19, 2022
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