summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2015-03-05 09:31:20 -0800
committerLiang Qi <liang.qi@theqtcompany.com>2015-03-06 06:19:47 +0000
commit9a3d7adaad367417aaa2e1ee1f996185a881a4b5 (patch)
tree7870a176c5c5c737ff3740f4e47d932156cf3c1f /src/corelib/kernel
parent4fe9798db3e32aae45d79bef7c1c82e50933658a (diff)
Fix -Wunreachable-code warning from clang in preprocessed Q_ASSERT
Q_ASSERT expands to: do {} while (false && (<your condition>)) Which is fine for Clang as long as it's a macro. However, when you compile as a preprocessed source, the macro is gone and Clang prints the warning: warning: code will never be executed [-Wunreachable-code] do {} while (false && (f())); ^ note: silence by adding parentheses to mark code as explicitly dead So add the parentheses that it's asking about. The changelog refers to the full Q_ASSERT change from ebef2ad1360c80ad62de5f4a1c4e7e4051725c1c. [ChangeLog][Important Behavior Changes] Q_ASSERT will now expand the condition even in release mode when asserts are disabled, albeit in an unreachable code path. This solves compiler warnings about variables and functions that were unused in release mode because they were only used in assertions. Unfortunately, codebases that hid those functions and variables via #ifndef will need to remove the conditionals to compile with Qt 5.5. Change-Id: Ia0aac2f09e9245339951ffff13c8aa70229254d0 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Diffstat (limited to 'src/corelib/kernel')
0 files changed, 0 insertions, 0 deletions