Open
Conversation
… dominik/tt-1480-assert-more-counter-code
Author
|
The access checks were a red herring. |
Author
|
We still need the macro changes. |
toshok
approved these changes
Jul 10, 2024
| static_assert(true, "require semicolon") | ||
|
|
||
| // Same as |REPLAY_ASSERT| but won't Assert if the given condition is not true. | ||
| #define REPLAY_ASSERT_IF(cond, format, ...) \ |
There was a problem hiding this comment.
Can these be defined in terms of one another?
e.g. REPLAY_ASSERT_IF could be:
#define REPLAY_ASSERT_IF(cond, format, ...) \
if (cond) REPLAY_ASSERT(format, ##__VA_ARGS__)
and REPLAY_ASSERT_MAYBE_EVENTS_DISALLOWED could be:
#define REPLAY_ASSERT_MAYBE_EVENTS_DISALLOWED(format, ...) \
REPLAY_ASSERT_IF(!recordreplay::AreEventsDisallowed(), format, ##__VA_ARGS__);
or REPLAY_ASSERT_IF could be the one that's ultimately evaluated with REPLAY_ASSERT being defined as:
#define REPLAY_ASSERT(format, ...) \
REPLAY_ASSERT_IF(true, format, ## __VA_ARGS__)
otherwise I'd be concerned about things diverging between the macros.
Author
There was a problem hiding this comment.
- ❌Your first suggestion is a no-go, because suddenly you are evaluating
condeven when things are enabled. - 🤷♀️ I don't like the unnecessary
if (true)in your third suggestion. - ✅ I'm not concerned at all, since this is is going to be a very small set of often-used macros.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.