Skip to content

Rename _start to __CPROVER_start #721

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
Apr 4, 2017
Merged

Conversation

tautschnig
Copy link
Collaborator

While identifiers starting with _ (or __ ?) are reserved according to the C standard,
people nevertheless use them. Using __CPROVER_start will make collisions less
likely.

Includes cleanup so that, outside cegis, there is exactly one point where this
name is spelled out.

@@ -71,7 +71,7 @@ bool contains(const std::string &haystack, const std::string &needle)

bool handle_start(std::string &source, const std::string &line)
{
if ("void _start(void)" != line) return false;
if ("void __CPROVER_start(void)" != line) return false;
Copy link
Member

Choose a reason for hiding this comment

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

@@ -26,7 +26,7 @@ jsa_source_providert::jsa_source_providert(jsa_symex_learnt &lcfg) :
{
}

#define START_METHOD_PREFIX "void _start"
#define START_METHOD_PREFIX "void __CPROVER_start"
Copy link
Member

Choose a reason for hiding this comment

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

Does it make sense to put this into util/prefix.h to really have it in a single place?

@martin-cs
Copy link
Collaborator

martin-cs commented Mar 28, 2017 via email

@tautschnig
Copy link
Collaborator Author

There now really is just one point where the name is generated, which is also used from cegis.

The previous regression test may fail dependent on the platform.
While identifiers starting with _ are reserved according to the C standard,
people nevertheless use them. Using __CPROVER_start will make collisions less
likely.

Includes cleanup such that there is exactly one point where this name is spelled
out.
@peterschrammel
Copy link
Member

Just observing that we have 5 instances of "__CPROVER_initialize" and 3 instances of CPROVER_PREFIX "initialize" in the code. I'd prefer the latter...

@tautschnig
Copy link
Collaborator Author

I've created #735 to track cleanup of other uses of "__CPROVER_... - 181 cases, which I don't have time for on the spot.

@kroening kroening merged commit 57f9fa6 into diffblue:master Apr 4, 2017
@tautschnig tautschnig deleted the rename-_start branch April 4, 2017 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants