Skip to content

Feature expr2c extension #2599

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

Closed
wants to merge 5 commits into from

Conversation

mmuesly
Copy link
Contributor

@mmuesly mmuesly commented Jul 24, 2018

I tried to convert an exprt to compilable c code, but encountered some problems as struct type definitions and padding struct members are contained in the output.

This changes add a new class, that is capable to remove them from the conversion output.

Changing the behavior of expr2ct with parameters doesn't seem an easily feasible approach.

Further, "TRUE" and "FALSE" are not understood by the c compiler in the default case. I suggest to replace them with some accepted replacement values.

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

@@ -1998,14 +1918,12 @@ std::string expr2ct::convert_constant_bool(bool boolean_value)
{
// C doesn't really have these
if(boolean_value)
return "TRUE";
return "1";
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changing the boolean value was the original reason for this commit.

I am sorry for the reformatting around this change in the commit.

My intend was to change TRUE to 1 and FALSE to 0.

@peterschrammel
Copy link
Member

I think @thk123 has a patch that subsumes these changes. @thk123, can you have a look into upstreaming expr2cleanc please?

@tautschnig
Copy link
Collaborator

Some of the changes here are more appropriate and/or overlapping changes with #2001. But if there is a much cleaner solution (expr2cleanc?) then this will be much appreciated! Assigning to @thk123.

@mmuesly mmuesly force-pushed the feature_expr2c_extension branch from 659aa44 to 131bb8c Compare July 31, 2018 17:18
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: 131bb8c).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/80535721
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).

@mmuesly mmuesly force-pushed the feature_expr2c_extension branch from 131bb8c to 1381399 Compare August 2, 2018 18:35
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: 1381399).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/80797564
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).

@mmuesly
Copy link
Contributor Author

mmuesly commented Aug 7, 2018

@thk123 Have you had a chance to take a look on this? I might provide some support in merging this with other PR into a joined version und your guidance, if that helps.

I really would appreciate, if the output of expr2ct becomes compilable soon.

@thk123
Copy link
Contributor

thk123 commented Aug 9, 2018

@mmuesly sorry for the delay - done in #2704

@mmuesly
Copy link
Contributor Author

mmuesly commented Aug 9, 2018

Thanks, so I will close this PR in favor of #2704.

@mmuesly mmuesly closed this Aug 9, 2018
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.

5 participants