-
Notifications
You must be signed in to change notification settings - Fork 3k
Description
Description
- Type: Enhancement
- Related issue: IAR8 Support #5329
Enhancement
Reason to enhance or problem with existing solution
Mbed OS 5.8 will be a leap forward in compiler supports. ARM compiler v5.06 will be deprecated in favor of v6.7and IAR v7.8 will be deprecated in favor of IAR v8.2. For both of these compilers the major version change induce a change in the version of C++ they support:
mbed os 5.6
C++98 | C++11 | C++14 | |
---|---|---|---|
GCC 6 | X | X | X |
ARM 5.06 | X | ~ partial | - |
IAR 7.80 | X | - | - |
mbed-os 5.8
C++98 | C++11 | C++14 | |
---|---|---|---|
GCC 6 | X | X | X |
ARMC 6.7 | X | X | beta |
IAR 8.2 | - | - | X |
The choice of C++98 as the C++ standard supported by mbed was obvious for mbed OS 5.6 but it is not for mbed OS 5.8 because IAR v8.2 only compile in C++ 14 mode and does not provide backward compatibility mode.
As close as they are C++98, C++11 and C++14 standards are not 100% backward compatible. As a consequence an mbed os 5.8 application may compile on one compiler and not the other or act slightly differently. The introduction of new keywords may also breaks existing applications.
Suggested enhancement
There is no lowest common denominator between the compiler that mbed OS 5.8 will support. However C++14 is much closer to C++11 than C++98. I'd suggest to define C++11 as the mode used by C++ compilers when they compile an mbed application and use C++14 when the ARM compiler supports it officially (in beta actually).
From my perspective it doesn't mean that our codebase should allow new features of the standards mentioned above. I believe this question should be addressed in a different thread; we can use the CI to ensure that our code base follows our actual guideline.
Notes:
Breaking changes introduced by C++11 can be found in the Section C2 of the C++11 specification and breaking changes introduced by C++14 can be found in the section C3 of the C++14 specification.