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

assert: require semicolon on DEBUG_ASSERT #4737

Merged
merged 1 commit into from
May 1, 2022

Conversation

snue
Copy link
Contributor

@snue snue commented May 1, 2022

Make DEBUG_ASSERT() act more like a regular "function". This also silences linter warnings about statements without effect for the currently superfluous semicolons.

This PR does:

  • Wrap DEBUG_ASSERT expansion in do {} while(0) so the ; completes the statement.
  • Add the semicolons in the two places that omitted them.
  • Fix up the macro comments a bit and explain the behavior of the
    VERIFY_OR_DEBUG_ASSERT macro a little more.

Make DEBUG_ASSERT act more like a function. This also silences linter
warnings about statements without effect for the currently superfluous
semicolons. Do this for the "empty" release build macro as well.

Add the semicolons in the two places that omitted them.

Also fix up the macro comments a bit and explain the behavior of the
VERIFY_OR_DEBUG_ASSERT macro a little more.
@snue snue force-pushed the improve_assert_macros branch from 65dadfa to c3a1816 Compare May 1, 2022 14:27
@snue
Copy link
Contributor Author

snue commented May 1, 2022

@daschuer You were the last to touch these. Could you have a look?

Copy link
Member

@daschuer daschuer left a comment

Choose a reason for hiding this comment

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

LGTM, Thank you.

@daschuer daschuer merged commit 6f86760 into mixxxdj:main May 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants