Skip to content

Consider using hardened coding standards #17

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
svenstaro opened this issue Aug 25, 2013 · 5 comments
Closed

Consider using hardened coding standards #17

svenstaro opened this issue Aug 25, 2013 · 5 comments

Comments

@svenstaro
Copy link

I'm putting this up for discussion first before trying to make a patch. Currently cereal fails quite horribly when adding -Wshadow -Wextra -pedantic. Is compatibility with those flags something you guys care about? If so, I would likely fix a few of those errors.

@AzothAmmo
Copy link
Contributor

I suppose these are worth considering, probably in decreasing priority: Wextra, Wshadow, pedantic.

For pedantic I don't know if we can make this happen without decreasing the usability of the library. Consider the private access violation that pedantic throws, which is because has_member_serialize_impl uses cereal::access to get access to the private serialization functions. The way to suppress this error is to make has_member_serialize_impl a friend, but this is too cumbersome to do (and would apply to others in traits as well). If there is a better solution to this problem than supporting pedantic would not be an issue.

@bastih
Copy link
Contributor

bastih commented Aug 26, 2013

A few warnings from that combination come from the externals, so it would likely need some upstream patches to those as well?

@svenstaro
Copy link
Author

Yes, probably.

AzothAmmo added a commit that referenced this issue Dec 20, 2013
AzothAmmo added a commit that referenced this issue Dec 21, 2013
See issue #17

Somewhere along the way we've also broken our ability to compile with GCC 4.7.3.  We'll have to decide if we care about
supporting 4.7.3 or not.  The changes that break this are:

-there is no emplace in std::map (or related) in 4.7.3
-there are some enable_ifs in rapidjson's writer.h that are always false (which is fine), but
GCC 4.7.3 doesn't like this
@AzothAmmo
Copy link
Contributor

I should mention that a vast majority of these changes have to be made on our external libs. They'll probably stay more or less locked down unless people find issues with them or we feel sufficient reason to upgrade them.

AzothAmmo added a commit that referenced this issue Dec 21, 2013
@AzothAmmo
Copy link
Contributor

As a consequence of compiling with -pedantic, there are a few macros that no longer support a trailing semicolon. I'm not a huge fan of how this looks, but it's a super minor thing and can technically be forced with some dummy struct in each macro if others share the same view.

I'm going to mark this as closed - if people run into issues compiling with shadow, extra, or pedantic, they can open up individual issues to get things fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants