mirror of
https://github.com/github/codeql.git
synced 2026-03-27 17:58:17 +01:00
19 lines
457 B
C++
19 lines
457 B
C++
|
|
int globalVar; // GOOD (not static)
|
|
static int staticVar1; // GOOD (used)
|
|
static int staticVar2; // GOOD (used)
|
|
static int staticVar3 = 3; // GOOD (used)
|
|
static int staticVar4 = staticVar3; // GOOD (used)
|
|
static int staticVar5; // BAD (unused)
|
|
static int staticVar6 = 6; // BAD (unused)
|
|
static __attribute__((__unused__)) int staticVar7; // GOOD (unused but this is expected)
|
|
|
|
void f()
|
|
{
|
|
int *ptr = &staticVar4;
|
|
|
|
staticVar1 = staticVar2;
|
|
(*ptr) = 0;
|
|
}
|
|
|