Skip to content

Work around C++14 assert problem #12906

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

Merged
merged 2 commits into from
May 12, 2020
Merged

Conversation

kjbracey
Copy link
Contributor

@kjbracey kjbracey commented Apr 30, 2020

Summary of changes

During testing of #12425, a problem in ARM Compiler 6.13's assert was identified. This adds a general workaround and restores original code from that PR.

(Problem will ultimately be fixed in ARM Compiler 6.15, but the workaround seems to have no downside)

Impact of changes

Migration actions required

n/a

Documentation

None


Pull request type

[] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[X] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Feature update because it's changing #12425

Test results

[] No Tests required for this change (E.g docs only update)
[X] Covered by existing mbed-os tests (Greentea or Unittest)
[] Tests / results supplied as part of this PR

Reviewers


ARMC6's assert macro does not work in C++14 constexpr context as it should.
By defining __DO_NOT_LINK_PROMISE_WITH_ASSERT, we deactivate the
extension that breaks it (having `__promise` inside `assert` - see the
compiler manual).

The extension does not appear to be useful - we have no code using
ARMC6's `__promise` directly, and putting a `__promise` inside the
assert does not appear to affect code generation in my tests.
Now that we've got a workaround for ARMC6, asserts can be restored.
@mergify mergify bot added the needs: CI label Apr 30, 2020
@0xc0170
Copy link
Contributor

0xc0170 commented May 8, 2020

CI started

@mbed-ci
Copy link

mbed-ci commented May 8, 2020

Test run: SUCCESS

Summary: 6 of 6 test jobs passed
Build number : 1
Build artifacts

@0xc0170 0xc0170 merged commit f13db5f into ARMmbed:master May 12, 2020
@mergify mergify bot removed the ready for merge label May 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants