Skip to content

Define big-int operators for signed long [blocks: #2551]#3812

Merged
kroening merged 1 commit intodiffblue:developfrom
tautschnig:big-int-signed-log
Jan 22, 2019
Merged

Define big-int operators for signed long [blocks: #2551]#3812
kroening merged 1 commit intodiffblue:developfrom
tautschnig:big-int-signed-log

Conversation

@tautschnig
Copy link
Collaborator

Trying to use numeric_cast_v resulted in ambiguous overload errors.

  • Each commit message has a non-empty body, explaining why the change was made.
  • Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • n/a The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/
  • Regression or unit tests are included, or existing tests cover the modified code (in this case I have detailed which ones those are in the commit message).
  • n/a My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • n/a White-space or formatting changes outside the feature-related changed lines are in commits of their own.

Copy link
Collaborator

@martin-cs martin-cs left a comment

Choose a reason for hiding this comment

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

Seems reasonable, esp. to match unsigned long although it's not entirely clear to me why this is needed now.

Trying to use numeric_cast_v<signed long> resulted in ambiguous overload errors.
At the moment, we are in a few places wrongly using
`numeric_cast_v<std::size_t>` when it should be
`numeric_cast_v<std::ptrdiff_t>`. On non-Windows platforms, `std::ptrdiff_t` is
`signed long`. To enable the use of the correct `numeric_cast_v`, we need to
support the comparison operators.
@tautschnig
Copy link
Collaborator Author

The need for this arises with #2310/#2551 which cleans up all signed/unsigned conversions that Visual Studio is unhappy about. At the moment, we are in a few places wrongly using numeric_cast_v<std::size_t> when it should be numeric_cast_v<std::ptrdiff_t>. On non-Windows platforms, std::ptrdiff_t is signed long. (Now also added to the commit message.)

Copy link
Contributor

@allredj allredj left a comment

Choose a reason for hiding this comment

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

🚫
This PR failed Diffblue compatibility checks (cbmc commit: b341b65).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/97523246
Status will be re-evaluated on next push.
Please contact @peterschrammel, @thk123, or @allredj for support.

Common spurious failures:

  • the cbmc commit has disappeared in the mean time (e.g. in a force-push)
  • the author is not in the list of contributors (e.g. first-time contributors).

The incompatibility may have been introduced by an earlier PR. In that case merging this
PR should be avoided unless it fixes the current incompatibility.

Copy link
Contributor

@allredj allredj left a comment

Choose a reason for hiding this comment

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

✔️
Passed Diffblue compatibility checks (cbmc commit: 427cc92).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/97524640

@martin-cs
Copy link
Collaborator

@tautschnig : thanks!

@kroening kroening merged commit 3a28687 into diffblue:develop Jan 22, 2019
@tautschnig tautschnig deleted the big-int-signed-log branch January 22, 2019 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants