Skip to content

Commit caa3aa6

Browse files
committed
Improve the description of DEBUG_ASSERT()
1 parent e869551 commit caa3aa6

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

src/util/assert.h

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,17 @@ inline void mixxx_release_assert(const char* assertion, const char* file, int li
4444
} \
4545
while (0)
4646

47-
/// Checks that cond is true in debug builds. If cond is false then prints a
48-
/// warning message to the console. If Mixxx is built with
49-
/// MIXXX_DEBUG_ASSERTIONS_FATAL then the warning message is fatal. Compiles
50-
/// to nothing in release builds.
47+
/// Verifies that `cond` evaluates to `true` in debug builds. If not, a
48+
/// critical error message is printed. If Mixxx is built with
49+
/// `MIXXX_DEBUG_ASSERTIONS_FATAL`, the process is terminated or
50+
/// it breaks with SIGINT under gdb with command line option
51+
/// --debug-assert-break
5152
///
52-
/// In release builds, it marks cond as used and checks if it can be converted
53-
/// to bool. Be careful of the common mistake with assertions:
54-
/// DEBUG_ASSERT(doSomething());
55-
/// doSomething() is never called, in In release builds.
53+
/// This macro expands to no runtime code in release builds. At compile time
54+
/// `cond` is however verified to be convertible to `bool`.
55+
/// Be careful of the common mistake with assertions:
56+
/// `DEBUG_ASSERT(doSomething());`
57+
/// `doSomething()` is never called, in In release builds.
5658
#ifdef MIXXX_DEBUG_ASSERTIONS_ENABLED
5759
#define DEBUG_ASSERT(cond) \
5860
do \

0 commit comments

Comments
 (0)