mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
jsoncpp: force explicit casts for integer to floating point conversions
This commit is contained in:
parent
2fb442366f
commit
ffbf7e6c7a
@ -19,7 +19,14 @@ if(EMSCRIPTEN)
|
||||
# at the moment.
|
||||
set(JSONCPP_CXX_FLAGS -std=c++17)
|
||||
else()
|
||||
set(JSONCPP_CXX_FLAGS ${CMAKE_CXX_FLAGS})
|
||||
# jsoncpp uses implicit casts for comparing integer and
|
||||
# floating point numbers. This causes clang-10 (used by ossfuzz builder)
|
||||
# to error on the implicit conversions. Here, we request jsoncpp
|
||||
# to unconditionally use static casts for these conversions by defining the
|
||||
# JSON_USE_INT64_DOUBLE_CONVERSION preprocessor macro. Doing so,
|
||||
# not only gets rid of the implicit conversion error that clang-10 produces
|
||||
# but also forces safer behavior in general.
|
||||
set(JSONCPP_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DJSON_USE_INT64_DOUBLE_CONVERSION")
|
||||
endif()
|
||||
|
||||
set(byproducts "")
|
||||
|
Loading…
Reference in New Issue
Block a user