File: README-assert-with-side-effects.md

package info (click to toggle)
clazy 1.17-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,248 kB
  • sloc: cpp: 23,552; python: 1,450; xml: 450; sh: 237; makefile: 46
file content (13 lines) | stat: -rw-r--r-- 450 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
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

This check is experimental and will have many false positives and might be buggy. Patches accepted!