Skip to content

Commit 5122f7c

Browse files
committed
C++: Add heuristics for meson configuration files
1 parent afd33e4 commit 5122f7c

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

cpp/ql/lib/semmle/code/cpp/ConfigurationTestFile.qll

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,19 @@ class CmakeTryCompileFile extends ConfigurationTestFile {
2626
)
2727
}
2828
}
29+
30+
/**
31+
* A file created by Meson to test the system configuration.
32+
*/
33+
class MesonPrivateTestFile extends ConfigurationTestFile {
34+
MesonPrivateTestFile() {
35+
this.getBaseName() = "testfile.c" and
36+
exists(Folder folder, Folder parent |
37+
folder = this.getParentContainer() and
38+
parent = folder.getParentContainer()
39+
|
40+
folder.getBaseName().matches("tmp%") and
41+
parent.getBaseName() = "meson-private"
42+
)
43+
}
44+
}
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
| testfile.c:6:3:6:8 | call to strlen | This expression has no effect (because $@ has no external side effects). | testfile.c:3:8:3:13 | strlen | strlen |

0 commit comments

Comments
 (0)