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

Many strict-aliasing warnings #16

Open
GoogleCodeExporter opened this issue Apr 20, 2016 · 0 comments
Open

Many strict-aliasing warnings #16

GoogleCodeExporter opened this issue Apr 20, 2016 · 0 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
Using the library in my project. build it.

What is the expected output? What do you see instead?
Many strict-aliasing warnings issued at
reference btree_node::value(int i)
What version of the product are you using? On what operating system?
1.0.1,linux, gcc 4.5.1

Please provide any additional information below.
My solution:
Add a cast function:
template <typename To, typename From>
To reconst_cast(From& from) {
  return reinterpret_cast<To>(from);
}

template <typename Params>
class btree_node {
  ...
  reference value(int i) {
    return reconst_cast<reference>(fields_.values[i]);
  }
  const_reference value(int i) const {
    return reconst_cast<const_reference>(fields_.values[i]);  }

See thr attachment.

Original issue reported on code.google.com by chen3feng on 7 Apr 2013 at 4:05

Attachments:

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

1 participant