Hello,
GCC 10.1 is out, and with it, come fairly complete c++20 support.
linux early adopter can try out arm-none-eabi-gcc-10.1 here : arm-none-eabi-gcc-10.1 archive
One think that will hit embedded developper is the change relative to the volatile keyword:
https://www.youtube.com/watch?v=KJW_DLaVXIY
in short,
1/volatile can only be used to declare variable, and no be in signature function
2/compound assignment (+=, |= ,&=, ....) is forbidden on volatile variable.
So, no hurry, gcc10 will not hit arm official repository before a while, but when it will do, lot of code will break in stm and chibios header that will be include by c++20 code.
Don't kwow if this change will be include in future revision of C language, but that's not impossible.
Alexandre
c++20 : semantic change of volatile keyword
- Giovanni
- Site Admin
- Posts: 14891
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: c++20 : semantic change of volatile keyword
That would be a mess, most likely. The kernels do not use volatile much but register header files are filled with those.
Giovanni
Giovanni
Re: c++20 : semantic change of volatile keyword
I think the intent is to clear the muddy usages of volatile, frequently confused with atomicity in multithreaded development under C++.
The qualifier will remain present for load and store operations, in here Jf Bastien's mentions having a more expressive alternative perhaps something like volatile_load, volatile_store as instructions instead of the meaning of volatile as a property of the type.
Alex, from what I could gather volatile will still be accepted as a member qualifier (Goal 3 in the video) for C++20 although longer term is for it to be gone. On the contrary, non-reference & non-pointer return and parameters variable volatile qualifications are deprecated.
Thanks for sharing this,
Raul
The qualifier will remain present for load and store operations, in here Jf Bastien's mentions having a more expressive alternative perhaps something like volatile_load, volatile_store as instructions instead of the meaning of volatile as a property of the type.
Alex, from what I could gather volatile will still be accepted as a member qualifier (Goal 3 in the video) for C++20 although longer term is for it to be gone. On the contrary, non-reference & non-pointer return and parameters variable volatile qualifications are deprecated.
Thanks for sharing this,
Raul