Skip to content
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

DM-14004: Make astshim compliant with the -pedantic compiler flag #44

Merged
merged 3 commits into from Apr 5, 2018

Conversation

r-owen
Copy link
Contributor

@r-owen r-owen commented Apr 5, 2018

No description provided.

delete[] array;
}
}
};
Copy link
Member

Choose a reason for hiding this comment

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

This is not safe at present; if you copy this object, array will get deleted twice.

I think the best way to fix that is to use unique_ptr<char[]> (see http://en.cppreference.com/w/cpp/memory/unique_ptr/operator_at), which is probably simple enough that you don't need a separate class.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Excellent suggestion. I implemented that. Please review again.

char * array[nchar]; is not C++ compliant and fails to build with
the -pedantic compiler flag, so use std::unique_ptr<char[]> instead.
both by scons (add setup.cfg and tweak tests/SConscript)
and Travis on github (add .travis.yml)
Copy link
Member

@TallJimbo TallJimbo left a comment

Choose a reason for hiding this comment

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

Looks good!

@r-owen r-owen merged commit f4f7515 into master Apr 5, 2018
@ktlim ktlim deleted the tickets/DM-14004 branch August 25, 2018 04:31
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.

None yet

2 participants