mirror of
https://github.com/github/codeql.git
synced 2026-04-11 18:14:01 +02:00
Merge pull request #21618 from jketema/meson-silence
C++: Add heuristics for meson configuration files
This commit is contained in:
4
cpp/ql/lib/change-notes/2026-03-31-meson.md
Normal file
4
cpp/ql/lib/change-notes/2026-03-31-meson.md
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
category: feature
|
||||
---
|
||||
* Added a subclass `MesonPrivateTestFile` of `ConfigurationTestFile` that represents files created by Meson to test the build configuration.
|
||||
@@ -26,3 +26,19 @@ class CmakeTryCompileFile extends ConfigurationTestFile {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A file created by Meson to test the system configuration.
|
||||
*/
|
||||
class MesonPrivateTestFile extends ConfigurationTestFile {
|
||||
MesonPrivateTestFile() {
|
||||
this.getBaseName() = "testfile.c" and
|
||||
exists(Folder folder, Folder parent |
|
||||
folder = this.getParentContainer() and
|
||||
parent = folder.getParentContainer()
|
||||
|
|
||||
folder.getBaseName().matches("tmp%") and
|
||||
parent.getBaseName() = "meson-private"
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
Likely Bugs/Likely Typos/ExprHasNoEffect.ql
|
||||
@@ -0,0 +1,8 @@
|
||||
typedef long long size_t;
|
||||
|
||||
size_t strlen(const char *s);
|
||||
|
||||
int main() {
|
||||
strlen(""); // GOOD: the source file occurs in a `meson-private/tmp.../testfile.c` directory
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user