diff options
Diffstat (limited to 'docs/checks/README-assert-with-side-effects.md')
-rw-r--r-- | docs/checks/README-assert-with-side-effects.md | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/docs/checks/README-assert-with-side-effects.md b/docs/checks/README-assert-with-side-effects.md new file mode 100644 index 00000000..5f375749 --- /dev/null +++ b/docs/checks/README-assert-with-side-effects.md @@ -0,0 +1,13 @@ +# assert-with-side-effects + +Tries to find `Q_ASSERT`s with side-effects. Asserts are compiled-out in release mode so you shouldn't put any important code inside them. + +#### Example +``` + // The connect statement wouldn't run in release mode + Q_ASSERT(connect(buttonm, &QPushButton::clicked, this, &MainWindow::handleClick)); +``` + +#### Pitfalls + +As this is a level3 check, it will have many false positives and might be buggy. Patches accepted! |