Skip to content

fixed some compiler errors with USE_BOOST_INT128#7833

Merged
chrchr-github merged 1 commit intodanmar:mainfrom
firewave:int128
Sep 20, 2025
Merged

fixed some compiler errors with USE_BOOST_INT128#7833
chrchr-github merged 1 commit intodanmar:mainfrom
firewave:int128

Conversation

@firewave
Copy link
Copy Markdown
Collaborator

No description provided.

Comment thread lib/clangimport.cpp Dismissed
Comment thread lib/token.h Dismissed
Comment thread lib/token.h Dismissed
@sonarqubecloud
Copy link
Copy Markdown

@chrchr-github
Copy link
Copy Markdown
Collaborator

What's the status of USE_BOOST_INT128? Maybe we should build it in the CI.

@firewave
Copy link
Copy Markdown
Collaborator Author

What's the status of USE_BOOST_INT128?

Getting quite close. ValueFlow::getSizeOf() needs to be sorted out. But the biggest blocker is arithmetic which is not supported by the type and I am not totally sure how to handle that. An intermediate solution I had in mind was to cast it to long long and give a debug message when it is out of range (I assume that will give some of the warnings we would also get if we enable -fsanitize=integer - and probably will spark controversy - again).

Maybe we should build it in the CI.

That's the plan when it fully builds.

@chrchr-github
Copy link
Copy Markdown
Collaborator

What's the status of USE_BOOST_INT128?

Getting quite close. ValueFlow::getSizeOf() needs to be sorted out. But the biggest blocker is arithmetic which is not supported by the type and I am not totally sure how to handle that.

Why would there be no arithmetic? This looks like at least the common operations are supported:
https://www.boost.org/doc/libs/1_87_0/libs/multiprecision/doc/html/boost_multiprecision/tut/ints/cpp_int.html

@firewave
Copy link
Copy Markdown
Collaborator Author

arithmetic which is not supported by the type

<<, ^, & et al. And then there's calls to math.h functions.

@chrchr-github chrchr-github merged commit 6e55812 into danmar:main Sep 20, 2025
61 checks passed
@firewave firewave deleted the int128 branch September 21, 2025 08:01
@firewave
Copy link
Copy Markdown
Collaborator Author

FYI

Using __int128 it already compiles and only lacks the string conversion of actual 128-bit values. I will prepare a PR so that can already be used.

Getting that much further uncovered issues with MathLib::calculate() and friends with unsigned values (i.e. greater than LLONG_MAX since it only provides signed results.

I will file appropriate tickets within the next days.

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.

3 participants