mirror of
https://github.com/github/codeql.git
synced 2026-08-04 09:23:23 +02:00
36 lines
459 B
C
36 lines
459 B
C
|
|
int z;
|
|
|
|
int pureFun(void) {
|
|
return 3;
|
|
}
|
|
|
|
int imPureFun(void) {
|
|
z++;
|
|
return 4;
|
|
}
|
|
|
|
int strcmp(char *x, char *y);
|
|
int unknownFun(char *x, char *y);
|
|
|
|
void f(int x, int y) {
|
|
if (x && y)
|
|
x++;
|
|
|
|
if (x && y++) // $ Alert
|
|
x++;
|
|
|
|
if (x && pureFun())
|
|
x++;
|
|
|
|
if (x && imPureFun()) // $ Alert
|
|
x++;
|
|
|
|
if (x && strcmp("foo", "bar"))
|
|
x++;
|
|
|
|
if (x && unknownFun("foo", "bar")) // $ Alert
|
|
x++;
|
|
}
|
|
|