-
Notifications
You must be signed in to change notification settings - Fork 703
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
Update to C++17 #560
Update to C++17 #560
Conversation
This PR does not address all the warnings, but it does address a good number of them |
22fdbb1
to
4d9b862
Compare
HI @kheaactua , |
There's no strictly compelling reason. However it does provide advantages such as We use AOSP (C++20) and QNX 7.1 (C++17), this commit was first created for 3.1.20 which actually had C++17 incompatible code (configuration_impl::trim) I can re-submit this PR without the C++17 specific changes if that's preferred. I left them in this submission just in case Covesa was interesting in the language standard change. (I'm not sure when dependencies such as boost or asio will start requiring more than C++11) I can also switch the code to west-side const (I see the preference for that in 9952fea) |
we will check this internally @kheaactua |
- Fixing narrowing issues - Removing useless copies - Removing unused lines - unused-lambda-capture - Removes unused variables - Fix some casts (modernize c-style, or simply remove useless casts) - Explicitly deleting unused endpoint_impl copy and move constructors - Removing redundant std::bind - Improving const correctness - Moving thread init to constructor body - Moved check_routing_credentials_ inside vsomeip security section where it's used - Using =default destructor instead of empty destructor Thread init: Moving the initialization of these threads into the constructor body to ensure that they do not start with an incomplete "this". As they capture this, it is possible that if the new thread begins before the object is fully constructed, the new thread might operate on uninitialized members of "this".
4d9b862
to
9ac4191
Compare
@kheaactua with force push it is not easy for the reviews and this will take more time. |
Oh, sorry about that. It's SOP at work so I suppose just a habit. Plus I noticed some work jira IDs in the commit messages that I wanted to remove. Now that I know I won't force push in the future. |
Hi @kheaactua, can you have a look at the failing windows build? |
Will do! I thought I had but I suppose that was a different PR. |
@fcmonteiro All tests pass! |
@kheaactua I tried to create a draft PR with all the changes as per this PR and looks like there is compatibility issue with boost-1.65.0 and the build fails for boost 1.65 whereas there is no issue with the boost-1.83.0 and it builds with success |
@kheaactua , part of the failing log,
|
Fun... Okay, I'll take a look. Thanks for the log! |
What compiler was used? I'm able to build this branch with boost 1.65 using Clang 17.0.6 on Linux. |
CXX compiler identification is GNU 11.4.0 |
Great, I'll spin up a container and try the build again |
(still haven't had a chance to test with gcc 11 / boost 1.55, will do though) |
We have found the issue to be Boost (1.65) Interval Container Library (ICL) does not compile with C++17, because in C++17 there was a change regarding templates (Please refer to this page, "New template template-parameter matching"). We are still analyzing this and making some cleanups internally, but we will probably bump the minimum Boost support to 1.66 which already fix this problem. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @kheaactua,
Changes look good. Just need to fix some style issues.
implementation/endpoints/src/local_uds_client_endpoint_impl.cpp
Outdated
Show resolved
Hide resolved
implementation/endpoints/src/local_uds_server_endpoint_impl.cpp
Outdated
Show resolved
Hide resolved
implementation/service_discovery/src/service_discovery_impl.cpp
Outdated
Show resolved
Hide resolved
implementation/service_discovery/src/service_discovery_impl.cpp
Outdated
Show resolved
Hide resolved
I think I addressed all the comment. In the last push it looked like
Looks like it'll have to be a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Modernizing to C++17
Address compiler warnings:
endpoint_impl
copy and move constructorsconst
correctnesscheck_routing_credentials_
inside vsomeip security section whereit's used
=default
destructor instead of empty destructorThread init:
Moving the initialization of these threads into the constructor body to ensure that they do not start with an incomplete "this". As they capture this, it is possible that if the new thread begins before the object is fully constructed, the new thread might operate on uninitialized members of "this".