Skip to content
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

core: Make assert() be an expression. #9136

Merged
merged 1 commit into from
May 15, 2018
Merged

Conversation

jcarrano
Copy link
Contributor

I was having some problems with code that expected the assert() macro to behave as an expression. Specifically, it was used with the comma operator like:

(expr_with_side_effects, assert(some_condition))

The "verbose" alternative for assert() was causing problems because it was defined with an if block. This PR solves that.

The "verbose" alternative for assert() is now an expression and
can be used in all the places that a funcion call can be used.
@jnohlgard jnohlgard added Area: core Area: RIOT kernel. Handle PRs marked with this with care! Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels May 15, 2018
Copy link
Member

@jnohlgard jnohlgard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine to me

@jnohlgard jnohlgard added the CI: run tests If set, CI server will run tests on hardware for the labeled PR label May 15, 2018
@jnohlgard jnohlgard added this to the Release 2018.07 milestone May 15, 2018
Copy link
Contributor

@kaspar030 kaspar030 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK.

@kaspar030 kaspar030 merged commit 8fd0136 into RIOT-OS:master May 15, 2018
@jcarrano jcarrano deleted the fix-assert branch November 8, 2018 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: core Area: RIOT kernel. Handle PRs marked with this with care! CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR CI: run tests If set, CI server will run tests on hardware for the labeled PR Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants