Skip to content

C++11 conversion#7

Open
neheb wants to merge 9 commits intoewsi:masterfrom
neheb:cpp11
Open

C++11 conversion#7
neheb wants to merge 9 commits intoewsi:masterfrom
neheb:cpp11

Conversation

@neheb
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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 <rosenp@gmail.com>
Found with modernize-use-noexcept

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Found with modernize-use-equals-default

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Found with modernize-use-override

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Found with hicpp-use-equals-delete

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Found with readability-redundant-string-cstr

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Found with modernize-use-auto

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Found with modernize-convert-loop

Signed-off-by: Rosen Penev <rosenp@gmail.com>
@neheb
Copy link
Copy Markdown
Contributor Author

neheb commented Jan 26, 2020

Rebased.

@neheb
Copy link
Copy Markdown
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