-
Notifications
You must be signed in to change notification settings - Fork 3k
Remove unreachable statements warnings #11439
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
Remove unreachable statements warnings #11439
Conversation
@hugueskamba, thank you for your changes. |
1041181
to
f02a4f1
Compare
f02a4f1
to
682e2ef
Compare
Note that some environments would actually treat an For example:
When NDEBUG is off, the compiler must check for But conceivably in a release build with NDEBUG, it could leave out the assert failure check, but still believe the assertion - assume that x > 3 as we claim, and hence still leave out the We (and the standard C library assert) don't do that - instead both guarantee that our macro does nothing if NDEBUG is set, rather than believing the assertion. But it is a possible different assert implementation. I guess my point is to consider what would happen if the compiler believed our assertions. Would the rest of the code make sense? If not, you probably want to have more explicit "if (condition) error or return" code. |
682e2ef
to
eb5574d
Compare
This force-push uses the "if (condition) error or return" code instead of assertions. |
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.
Seems reasonable to me.
eb5574d
to
e58f40b
Compare
CI started |
Test run: FAILEDSummary: 1 of 4 test jobs failed Failed test jobs:
|
CI restarted |
Test run: FAILEDSummary: 2 of 11 test jobs failed Failed test jobs:
|
Test run: FAILEDSummary: 3 of 4 test jobs failed Failed test jobs:
|
@0xc0170, |
Will restart after rc2 generation, need 2 more patches to get in |
Aborted, rc2 jobs are in now, will be restarted |
Test run: FAILEDSummary: 6 of 11 test jobs failed Failed test jobs:
|
Ci restarted |
Test run: FAILEDSummary: 2 of 11 test jobs failed Failed test jobs:
|
tests restarted |
Ci restarted again |
CI started |
Test run: FAILEDSummary: 2 of 11 test jobs failed Failed test jobs:
|
Test restarted |
CI restarted again |
Restarted entire pipeline |
Test run: FAILEDSummary: 2 of 11 test jobs failed Failed test jobs:
|
hal/mbed_ticker_api.c
Outdated
@@ -41,8 +41,9 @@ static void initialize(const ticker_data_t *ticker) | |||
|
|||
const ticker_info_t *info = ticker->interface->get_info(); | |||
uint32_t frequency = info->frequency; | |||
|
|||
MBED_ASSERT(info->frequency == 0); |
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.
Please review latest failures. Looks like we are hitting this assert in the tests. ERROR reported for all platforms there.
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.
The warnings are observed when building with the IAR toolchain.
e58f40b
to
5724c4c
Compare
This force-push uses the "if (condition) error or return" code instead of assertions for |
CI restarted |
Test run: SUCCESSSummary: 11 of 11 test jobs passed |
Description
Remove unreachable statements warnings reported when building with the IAR toolchain.
Warnings observed when building the
mbed-os-example-blinky
example project with the following command:mbed compile -t IAR -m K64F
Pull request type
Reviewers
Release Notes