-
Notifications
You must be signed in to change notification settings - Fork 143
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
Enable C++20 #521
Enable C++20 #521
Conversation
rleh
commented
Dec 19, 2020
- Update ARM GCC to version 10
- Use new Docker images (hosted on Github Container Registry ghcr.io)
- Update installation guide
- Enable C++20
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.
MacOS CI may fail until homebrew is updated.
|
Oh yeah, I forgot C++20 deprecated |
Errors
|
STM32 UnittestsFLASH' overflowed by 10424 bytes
|
Yes, the F103 was like 98% full before… so I guess there's been a little regression in GCC code size? |
There is already a lot disabled for STM32F1: https://github.com/modm-io/modm/blob/develop/test/config/nucleo-f103.xml <modules>
<module>modm:platform:heap</module>
<!-- Not everything fits -->
<!-- <module>modm-test:test:architecture</module>
<module>modm-test:test:communication</module>
<module>modm-test:test:container</module>
<module>modm-test:test:driver</module>
<module>modm-test:test:io</module> -->
<module>modm-test:test:platform:**</module>
<module>modm-test:test:processing</module>
<module>modm-test:test:ui</module>
<module>modm-test:test:math</module>
</modules> |
Only some parts are deprecated of course. Otherwise the compiler would optimize away all hardware register accesses. There is still no other way to tell the compiler not to mess with your memory mapped IO. They deprecated all the insane nonsensical parts no-one should ever use, like volatile qualified member functions, volatile return values, volatile function parameters, etc. The annoying part is they also deprecated some parts which are ubiquitously used in vendor provided code. Compound operations on volatiles like |
From P1152R4 "Deprecating volatile"
|
Reddit flamewar discussion on that topic: Compound assignment to volatile must be un-deprecated |
Scathing… |
We might have a few
It has to go to the front. I am quite sure written like above it does nothing despite giving the warning about misuse of attributes. |
I'll have a look at the |
Now another error on Windows hosted:
Has anyone seen |
Probably because I exchanged MinGW32 with a gcc-10 based Mingw64... |
Don't you see the
|
https://stackoverflow.com/a/55099671
|
1bd343a
to
2284a3b
Compare
😒
|
fabs is not required to be constexpr, not even in C++20 but in libstdc++ it actually is. Should I fix it by putting a constexpr version in there?
|
Sehr gerne! |
Ok, I'll do it. |
Could you have a look at it and cherry-pick the commit? chris-durand@6578b24 |
2284a3b
to
0bebd2e
Compare
I am fixing AVR We should consider to move to llvm for AVR at some point because they have solved the problem with the separated flash address space in a beautiful way, no need for |
Fix for Date classes on AVR: #530 |
@salkinium Are you ok with merging this PR despite of 169dfab? |
Yes. |
Apart from the communication tests everything passes on AVR with #531 and the branch rebased to develop.
|
The xpcc AVR tests succeed whereas sab fails.
|
I don't intend to fix the SAB implementation because it's broken unrelated to this PR. The interface of |
Thanks @chris-durand for the great help with the tests! I suggest to merge the pull request soon and then see which further improvements or bug fixes come up in the future. |
@@ -260,7 +260,8 @@ def common_compiler_flags(compiler, target): | |||
# "-Wnon-virtual-dtor", | |||
# "-Wold-style-cast", | |||
"-fstrict-enums", | |||
"-std=c++17", | |||
"-std=c++20", | |||
"-Wno-volatile", # volatile is deprecated in C++20 but lots of our external code uses it... |
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.
Note that not every thing volatile is deprecated, but nearly every peace of exiting embedded vendor code.
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.
Yes, in theory a good idea, just not very practical: #521 (comment)