-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Add option to use boost::multiprecision on platforms where int128_t i… #3430
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -997,7 +997,7 @@ ExprEngine::ConditionalValue::Vector ExprEngine::ArrayValue::read(ExprEngine::Va | |
if (i->minValue >= 0 && i->minValue == i->maxValue) { | ||
int c = 0; | ||
if (i->minValue < stringLiteral->size()) | ||
c = stringLiteral->string[i->minValue]; | ||
c = stringLiteral->string[static_cast<size_t>(i->minValue)]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since this is 128-bit now it will probably cause problems when it doesn't fit into |
||
ret.push_back(std::pair<ValuePtr,ValuePtr>(indexAndValue.index, std::make_shared<ExprEngine::IntRange>(std::to_string(c), c, c))); | ||
continue; | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,13 +40,18 @@ class Variable; | |
#if defined(__GNUC__) && defined (__SIZEOF_INT128__) | ||
typedef __int128_t int128_t; | ||
#else | ||
#if defined(USE_BOOST_MULTIPREC) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be the first case. If we configure to use it we should use it across all platforms |
||
#include <boost/multiprecision/cpp_int.hpp> | ||
using int128_t = boost::multiprecision::int128_t; | ||
#else | ||
typedef long long int128_t; | ||
#ifdef _MSC_VER | ||
#pragma message(__FILE__ "(" _CRT_STRINGIZE(__LINE__) ")" ": warning: TODO No 128-bit integer type is available => Limited analysis of large integers...") | ||
#else | ||
#warning TODO No 128-bit integer type is available => Limited analysis of large integers | ||
#endif | ||
#endif | ||
#endif | ||
|
||
namespace ExprEngine { | ||
std::string str(int128_t); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should use:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this makes it specific to lib_objs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's
add_definitions(-DUSE_BOOST_MULTIPREC)
-target_compile_definitions()
is not available in CMake 2.8 (let's tackle a CMake update later - if I ever get healthy again).Also those should be placed in
findDependencies.cmake
andcompilerDefinitions.cmake
.Also those should be
PRIVATE
so they don't spill into everything.