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

C++11 conversion #7

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

C++11 conversion #7

wants to merge 9 commits into from

Conversation

neheb
Copy link
Contributor

@neheb neheb commented Oct 11, 2019

Cleans up the code a bit with modern techniques. Some size improvements.

Still compatible with uClibc++. Only needs a modern C++ compiler (GCC 4.8.1).

@csonsino csonsino self-assigned this Oct 15, 2019
@csonsino
Copy link
Collaborator

My Jenkins job is failing a standard Linux build (not OpenWrt) because I don't have -std=c++11 in my CXXFLAGS. Can we add this, and where would be the best place- configure.ac?

@neheb
Copy link
Contributor Author

neheb commented Oct 15, 2019

Hmm? GCC has defaulted to C++11 since 4.8.

configure.ac is a good place to add, yes.

@csonsino
Copy link
Collaborator

Well I got it to compile fine by adding the -std=c++11 to my Jenkins build script, but I'd prefer if it built without having to include that.

Jenkins is running on an Ubuntu 16.04 box:
gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.11)

Running this magic command seems to indicate that c++ 1998 (or maybe 2003?) is the default:

$ g++ -dM -E -x c++  /dev/null | grep -F __cplusplus
#define __cplusplus 199711L

@neheb
Copy link
Contributor Author

neheb commented Oct 16, 2019

Ah yes GCC changed their policy regarding that with GCC7. They default to highest stable version now.

One reason for the C++11 changes is smaller compiled size.

neheb added 8 commits January 25, 2020 21:25
Found with modernize-use-auto.

Signed-off-by: Rosen Penev <[email protected]>
Found with modernize-use-noexcept

Signed-off-by: Rosen Penev <[email protected]>
Found with modernize-use-equals-default

Signed-off-by: Rosen Penev <[email protected]>
Found with modernize-use-override

Signed-off-by: Rosen Penev <[email protected]>
Found with hicpp-use-equals-delete

Signed-off-by: Rosen Penev <[email protected]>
Found with readability-redundant-string-cstr

Signed-off-by: Rosen Penev <[email protected]>
Found with modernize-use-auto

Signed-off-by: Rosen Penev <[email protected]>
Found with modernize-convert-loop

Signed-off-by: Rosen Penev <[email protected]>
@neheb
Copy link
Contributor Author

neheb commented Jan 26, 2020

Rebased.

@neheb
Copy link
Contributor Author

neheb commented Jan 30, 2020

Merged your PR.

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.

2 participants