Skip to content

Use numeric_cast_v<std::size_t> instead of deprecated integer2size_t [blocks: #2310] #3051

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

Merged
merged 1 commit into from
Nov 9, 2018

Conversation

tautschnig
Copy link
Collaborator

@tautschnig tautschnig commented Sep 26, 2018

  • Each commit message has a non-empty body, explaining why the change was made.
  • My contribution is formatted in line with CODING_STANDARD.md.
  • n/a Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • 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.
  • White-space or formatting changes outside the feature-related changed lines are in commits of their own.

@tautschnig
Copy link
Collaborator Author

tautschnig commented Sep 26, 2018

I will revisit this once #3047 is merged (they have conflicting/duplicating changes).

@@ -1903,7 +1903,7 @@ bool goto_convertt::get_string_constant(
forall_operands(it, index_op)
if(it->is_constant())
{
unsigned long i=integer2ulong(
const std::size_t i = numeric_cast_v<std::size_t>(
binary2integer(id2string(to_constant_expr(*it).get_value()), true));

Copy link
Member

Choose a reason for hiding this comment

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

BTW, just ran into that one again (in #3100).

I'd advocate removing this method, given that I don't think it works.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Which method are you referring to? I wasn't able to figure out which problem #3100 is solving, so I'd need more info. Thanks!

@tautschnig tautschnig force-pushed the integer2size_t branch 2 times, most recently from fd61169 to 9cd404b Compare October 15, 2018 09:55
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: fd61169).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/87937825
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: 9cd404b).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/87938549

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.

This change appears to be as described in all the areas I am "owner" of.

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: d73108e).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/88736803

@tautschnig tautschnig force-pushed the integer2size_t branch 2 times, most recently from be727b4 to 23ff9c9 Compare October 31, 2018 20:39
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: 23ff9c9).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/89875998

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: 7a4c5e1).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/90159583
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.

@martin-cs
Copy link
Collaborator

How does this relate to #3252 ? Should this be updated / closed in light of that?

@tautschnig
Copy link
Collaborator Author

How does this relate to #3252 ? Should this be updated / closed in light of that?

No, they refer to two different types being converted to: this one is for std::size_t, #3252 was mp_integer.

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: 5d837c0).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/90496251

@tautschnig tautschnig changed the title Use numeric_cast_v<std::size_t> instead of deprecated integer2size_t Use numeric_cast_v<std::size_t> instead of deprecated integer2size_t [blocks: #2310] Nov 7, 2018
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: eca50ce).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/90620816
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.

integer2size_t is deprecated. Replacing it as recommended reduces the number of
warnings emitted at build time and actually implements what deprecation is
about.
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.

⚠️
Diffblue compatibility check is currently unavailable.
Please create manual bump.
(cbmc commit: fe3f73c).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/90844662

@romainbrenguier
Copy link
Contributor

Check actually passed ✔️

@tautschnig tautschnig merged commit 59f9e73 into diffblue:develop Nov 9, 2018
@tautschnig tautschnig deleted the integer2size_t branch November 9, 2018 12:34
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.

7 participants