Commit fd79f15
Fixed Qt config macro declaration (#8796)
The macro definition of `Q_ASSERT_X` results in false positives.
### Example
```cpp
#include <QDebug>
void test()
{
const char *where = "test";
const char *what = "assertion failed";
Q_ASSERT_X(false, where, what);
}
````
This code block results in:
```commandline
style: Variable 'where' is assigned a value that is never used.
[unreadVariable]
style: Variable 'what' is assigned a value that is never used.
[unreadVariable]
```
The existing definition discards `where` and `what` arguments when modeling `Q_ASSERT_X`. The fix preserves these arguments using `(void) (what)` and `(void) (where)`
---------
Co-authored-by: Daschle Newberry <dnewberry@deltamotion.com>
Co-authored-by: chrchr-github <78114321+chrchr-github@users.noreply.github.com>1 parent ff4d7ce commit fd79f15
3 files changed
Lines changed: 9 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| 104 | + | |
104 | 105 | | |
105 | 106 | | |
106 | 107 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5520 | 5520 | | |
5521 | 5521 | | |
5522 | 5522 | | |
5523 | | - | |
| 5523 | + | |
5524 | 5524 | | |
5525 | 5525 | | |
5526 | 5526 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
894 | 894 | | |
895 | 895 | | |
896 | 896 | | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
897 | 904 | | |
898 | 905 | | |
899 | 906 | | |
| |||
0 commit comments