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

Sets C++ and C standard versions in a single location (C++14 and C11) #1757

Merged
merged 1 commit into from May 16, 2019

Conversation

@avtolstoy
Copy link
Member

commented Apr 29, 2019

Problem

  1. We'd like to upgrade the C++ standard we use to C++14
  2. Almost every module seems to set its own C++ and/or C standard version

Solution

This PR removes all mentions of -std=xxx from the makefiles and adds a single build/lang-std.mk file setting C++ and C standard version (C++14 with GNU extensions, C11 with GNU extensions), which is then included by the other makefiles.

As we also have CMake-based unit-tests, exactly the same versions are separately set in test/CMakeLists.txt with notes in both lang-std.mk and CMakeLists.txt about keeping the standard versions in sync.

Steps to Test

N/A

Example App

N/A

References

  • [CH31589]

Completeness

  • User is totes amazing for contributing!
  • Contributor has signed CLA (Info here)
  • Problem and Solution clearly stated
  • Run unit/integration/application tests on device
  • Added documentation
  • Added to CHANGELOG.md after merging (add links to docs and issues)

  • [enhancement] Sets C++ and C standard versions in a single location (C++14 and C11) #1757

@avtolstoy avtolstoy added this to the 1.2.0-beta.3 milestone Apr 29, 2019

@avtolstoy avtolstoy requested review from sergeuz and technobly Apr 29, 2019

@technobly
Copy link
Member

left a comment

I was going to say how can we know that all of the places where gnu++11 was removed, and lang-std.mk was not added, will have gnu++14 set. But the GCC Standard says The default, if no C++ language dialect options are given, is -std=gnu++14. so we should be ok until we want to update to c++17.

@avtolstoy

This comment has been minimized.

Copy link
Member Author

commented Apr 29, 2019

lang-std.mk is always included by arm-tlm.mk, which is always included when building DeviceOS. Things that don't use regular DeviceOS build system (e.g. unit test) specifically include lang-std.mk.

@technobly technobly modified the milestones: 1.2.0-beta.3, 1.2.0-beta.2 Apr 29, 2019

@technobly technobly changed the base branch from develop to release/v1.2.0 Apr 29, 2019

@technobly technobly force-pushed the release/v1.2.0 branch from 054df97 to 9cf3e80 May 2, 2019

@technobly technobly modified the milestones: 1.2.0-beta.2, 1.2.0-rc.1 May 10, 2019

@technobly technobly force-pushed the release/v1.2.0 branch from 32b26fa to a8134d7 May 15, 2019

@technobly technobly changed the base branch from release/v1.2.0 to develop May 15, 2019

Sets C++ and C standard versions in a single location
Not entirely true, as for CMake-based unit-tests they are set in
CMakeLists.txt separately.

@avtolstoy avtolstoy force-pushed the feature/c-cpp-standard-version branch from 977e659 to e0e2532 May 16, 2019

@avtolstoy avtolstoy merged commit 1d22bac into develop May 16, 2019

1 check passed

continuous-integration/travis-ci/push The Travis CI build passed
Details

@avtolstoy avtolstoy deleted the feature/c-cpp-standard-version branch May 16, 2019

@technobly technobly removed the request for review from sergeuz May 16, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.