c++20 : semantic change of volatile keyword
Posted: Sun May 10, 2020 12:45 pm
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
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