Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d6f27f0

Browse files
committed
CPP: Add a test of macros.
1 parent 5f12c18 commit d6f27f0

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

cpp/ql/test/query-tests/Likely Bugs/Likely Typos/ExprHasNoEffect/ExprHasNoEffect.expected

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
| macros.c:6:9:6:13 | param | This expression has no effect. | macros.c:6:9:6:13 | param | |
12
| preproc.c:89:2:89:4 | call to fn4 | This expression has no effect (because $@ has no external side effects). | preproc.c:33:5:33:7 | fn4 | fn4 |
23
| preproc.c:94:2:94:4 | call to fn9 | This expression has no effect (because $@ has no external side effects). | preproc.c:78:5:78:7 | fn9 | fn9 |
34
| template.cpp:19:3:19:3 | call to operator++ | This expression has no effect (because $@ has no external side effects). | template.cpp:9:10:9:19 | operator++ | operator++ |
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
#define UNUSED(x) (x)
3+
4+
void test2(int param)
5+
{
6+
UNUSED(param); // GOOD [FALSE POSITIVE]
7+
}

0 commit comments

Comments
 (0)