-
Notifications
You must be signed in to change notification settings - Fork 3k
Change MBED_STATIC_ASSERTs version for built-in #13085
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
Conversation
While looking around in the code base for Inside this, I found redefinitions of both I was not sure what to do with this, since I am far outside of my comfort zone on the tests themselves. @kjbracey-arm @0xc0170 any thoughts? I could pull these in to this or create a new one. I could even modify #13002 even though I don't want to touch that. Still, that could possibly be the Right Thing To Do™. It does seem odd regarding the UNITTEST files duplicating the asserts completely. |
@pea-pod, thank you for your changes. |
If you're stripping them out of the code base, then you won't need the deprecated definitions for building unit tests. You could either bring the two copies of mbed_assert.h into closer alignment - copy the relevant changes over, minimising the diff - or you could just remove them. No strong opinion. No point modifying 13002. |
@bulislaw are you happy with this change? |
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.
LGTM
db5b4e7
to
dfb010e
Compare
dfb010e
to
9f93dcc
Compare
This PR cannot be merged due to conflicts. Please rebase to resolve them. |
@pea-pod Can you resolve conflicts please? |
9f93dcc
to
e4b4a84
Compare
@0xc0170 Done. |
CI started |
Test run: FAILEDSummary: 1 of 3 test jobs failed Failed test jobs:
|
@pea-pod Thanks, let's wait with a rebase. @kjbracey-arm you happy as the things are in this PR now? |
9c67bf6
to
507181d
Compare
Pull request has been modified.
@0xc0170 Is this ready? |
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.
All previous comments were addressed.
Would be good to restart CI.
@@ -23,7 +23,6 @@ | |||
#include <mstd_memory> | |||
#include <mstd_type_traits> | |||
#include <mstd_utility> | |||
#include "platform/mbed_assert.h" |
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.
I think the include should be kept.
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.
Why? Just to avoid compilation glitches from people who've been accidentally picking up MBED_ASSERT
via an <mstd_atomic>
include?
I agree this is a fairly common minor compatibility break - header implementations stopping including undocumented things - but don't recall it being a general rule not to do it.
In practice this is one of the less likely places to cause issues - there aren't many <mstd_atomic>
users around, cos it's relatively new. You'd be far more likely to get headaches from losing something in DigitalOut
or SerialBase
, and I've not noticed reluctance to tidy their includes.
Although having said that, I don't see any other tidies in this PR. Not sure if that's because they couldn't be done or they just haven't been.
I'll reopen soon, to start travis (the old job could not be restarted as it was prior migration). |
Needs to be ignored, the new status Travis CI - Pull Request . |
CI started |
Jenkins CI Test : ✔️ SUCCESSBuild Number: 2 | 🔒 Jenkins CI Job | 🌐 Logs & ArtifactsCLICK for Detailed Summary
|
I marked this as ready. I'll merge later today |
Summary of changes
Changes all of the
MBED_STATIC_ASSERT
andMBED_STRUCT_STATIC_ASSERT
instances tostatic_assert
and includesassert.h
for the the C files.In PR #13002 both MBED_STATIC_ASSERT and MBED_STRUCT_STATIC_ASSERT were deprecated. The macros now just call in place
static_assert
(or the C equivalent_Static_assert
) without modification. This removes reliance on theMBED[_STRUCT]_STATIC_ASSERT
throughout the mbed-os code base.Impact of changes
None.
Migration actions required
None.
Documentation
PR #13002 deprecates the use of
MBED_STATIC_ASSERT
andMBED_STRUCT_STATIC_ASSERT
as both of these uses are now fully supported by the minimum compiler levels. This PR may go through without any other PR preceding it, but the reasoning behind this removal comes from #13002.Pull request type
Test results
Reviewers