facebook / folly

An open-source C++ library developed and used at Facebook.
https://groups.google.com/forum/?fromgroups#!forum/facebook-folly
Apache License 2.0
28.31k stars 5.55k forks source link

conv.cpp causes int truncation errors in MSVC #1448

Open asklar opened 4 years ago

asklar commented 4 years ago

https://github.com/facebook/folly/blob/8f60f6338641eec89d7255625de81cc20af6a2a1/folly/Conv.cpp#L589

image

E:\rnw\node_modules\.folly\folly-2020.09.14.00\folly\Conv.cpp(589,18): error C2220: the following warning is treated as an error [E:\rnw\vnext\Folly\Folly.vcxproj]
E:\rnw\node_modules\.folly\folly-2020.09.14.00\folly\Conv.cpp(647): message : see reference to function template instantiation 'folly::Expected<char,folly::ConversionCode> folly::detail::digits_to<char>(const char *,const char *) noexce
pt' being compiled [E:\rnw\vnext\Folly\Folly.vcxproj]
E:\rnw\node_modules\.folly\folly-2020.09.14.00\folly\Conv.cpp(589,18): warning C4310: cast truncates constant value [E:\rnw\vnext\Folly\Folly.vcxproj]
Orvid commented 4 years ago

Folly can't be built with warnings as errors, that's just not a thing we make any attempt to support. We try to cleanup the vast majority of warnings, but accept that we will never be fully warning clean.