diff options
| author | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2025-02-03 19:03:01 +0100 |
|---|---|---|
| committer | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2025-02-04 14:52:02 +0100 |
| commit | 868645fd3be039e37c96315059ab0b851d022bf4 (patch) | |
| tree | 449d130332daa0007c4ac5517bfbee2c2973016a /src | |
| parent | 43cb7f93a4da2d57513acb3c4cbdd56c1eaf188f (diff) | |
Q_ASSERT_X: always consume `where` and `what`
Just like `cond` is always consumed to prevent -Wunused warnings,
do the same with `where` and `what`. They're not required to be
literals, but could be function locals that go unused otherwise.
Change-Id: I6b44108c2c040368319a85ec5f34d98930e0794c
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Diffstat (limited to 'src')
| -rw-r--r-- | src/corelib/global/qassert.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/global/qassert.h b/src/corelib/global/qassert.h index 388932a8f7f..bfdd69815a3 100644 --- a/src/corelib/global/qassert.h +++ b/src/corelib/global/qassert.h @@ -41,7 +41,7 @@ void qt_assert_x(const char *where, const char *what, const char *file, int line #if !defined(Q_ASSERT_X) # if defined(QT_NO_DEBUG) && !defined(QT_FORCE_ASSERTS) -# define Q_ASSERT_X(cond, where, what) static_cast<void>(false && (cond)) +# define Q_ASSERT_X(cond, where, what) static_cast<void>(false && (cond) && (where) && (what)) # else # define Q_ASSERT_X(cond, where, what) ((cond) ? static_cast<void>(0) : qt_assert_x(where, what, __FILE__, __LINE__)) # endif |
