Skip to content

[depends: #1063] Use nullptr to represent null pointers (targets master) #1159

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 2 commits into from
Jul 24, 2017

Conversation

reuk
Copy link
Contributor

@reuk reuk commented Jul 20, 2017

This PR was created using clang-tidy's auto-fix mode. To run clang-tidy, I had to generate a compile database, which required a CMake build. I wonder whether it would be worth creating another PR to add CMake support to CBMC master, but alongside the existing makefile build. We could add a single configuration to Travis that builds using CMake instead, to ensure that both builds are kept up-to-date.

@tautschnig
Copy link
Collaborator

I wholeheartedly support this PR. Yet I am wondering how we best deal with the linter warnings - are you ok dealing with them or should I pitch in and add a commit that takes care of them?

@reuk
Copy link
Contributor Author

reuk commented Jul 20, 2017

I can fix them.

@tautschnig
Copy link
Collaborator

Thanks!

@reuk
Copy link
Contributor Author

reuk commented Jul 20, 2017

Some of the linter complaints refer to bigint and miniz, as these modules were modified by the nullptr pass. As these are not strictly "our" code, I'm not sure how to proceed. Should the nullptr changes be rolled-back in these files, or should I leave them in place and fix the linter errors too?

@tautschnig
Copy link
Collaborator

Should the nullptr changes be rolled-back in these files, or should I leave them in place and fix the linter errors too?

I'm slightly in favour of rolling them back, but also any other approach is fine with me.

@reuk
Copy link
Contributor Author

reuk commented Jul 20, 2017

Should the linter be adjusted to ignore "external" code like these modules?

@@ -22,6 +22,8 @@ Author: Daniel Kroening, [email protected]

#include "interval_template.h"

#define nullptr_exceptiont(str) str
Copy link
Collaborator

Choose a reason for hiding this comment

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

I am wondering whether this is the best approach and right place to put?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is temporary, until #1063 gets merged. Of course this should be a custom exception type derived from invariant_failedt, and these common exception types should probably live in util. Should I add a "util/standard_exceptions.h" header and just put macros in it for now?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Would it be ok to wait for #1063 to get merged and then do it properly?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, that's fine with me.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Changed the PR title in a desperate attempt to introduce dependency tracking into github...

@@ -26,6 +26,9 @@ class is_threadedt;
class dirtyt;
class reaching_definitions_analysist;

#define bad_cast_exceptiont(str) str
#define nullptr_exceptiont(str) str
Copy link
Collaborator

Choose a reason for hiding this comment

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

Now I'm convinced this isn't the right place.

@tautschnig tautschnig changed the title Use nullptr to represent null pointers (targets master) [depends: #1063] Use nullptr to represent null pointers (targets master) Jul 20, 2017
@kroening kroening merged commit 80e4214 into diffblue:master Jul 24, 2017
@reuk
Copy link
Contributor Author

reuk commented Jul 24, 2017

This was not ready to be merged. It required fixes which depended on #1063.

@tautschnig
Copy link
Collaborator

@reuk Reverted after OOB comms with @kroening. Would you mind putting in an updated PR, now that #1063 is merged? Thanks!

@reuk
Copy link
Contributor Author

reuk commented Jul 24, 2017

Yes, I'll put together a new version once I have a chance.

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.

3 participants