-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Add std=c++11 to CMakeLists for older compilers #1594
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
I signed it! |
CLAs look good, thanks! |
Can you explain what problem this is fixing? We aren't expecting people to use c++11 compilers: are there parts of the code where c++11 has snuck in? You say "may cause errors" -> has it caused errors? |
I attached a build log I get when I compile the current version (master HEAD) on a Raspberry Pi with Raspbian Jessie and a gcc 4.9.2. With the fix I provided the error is gone. I think this is caused by the protobuf compiler which generates C++11 code by default. |
Thanks for more context! We should see if the latest protobuf version still has this problem: it seems they are considering branching and having a c++11 version and a non-c++11 version so they didn't intend to turn it on... |
I tested the current libphonenumber (1f69a99) together with the current protobuf (protocolbuffers/protobuf@f0a5c10) version with the gcc 4.9 I don't get any errors. So it works without c++11 again. However if the protobuf team decides to move their future development to a c++11 based version, libphonenumber should probably go the same way so that the newest version can be used. A pre c++11 fork would only receive bug-fix support and on systems that ship the new version by default one would have to manage two versions. |
Great to hear it works again! |
Compiling the library with older compilers like gcc 4.9 that do not compile the code with the C++11 standard by default may cause errors. Therefore I created this pull request that adds the C++11 standard explicitly.
This change is