Merge pull request #21618 from jketema/meson-silence

C++: Add heuristics for meson configuration files
This commit is contained in:
Jeroen Ketema
2026-03-31 15:24:22 +02:00
committed by GitHub
5 changed files with 29 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
---
category: feature
---
* Added a subclass `MesonPrivateTestFile` of `ConfigurationTestFile` that represents files created by Meson to test the build configuration.

View File

@@ -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"
)
}
}

View File

@@ -0,0 +1 @@
Likely Bugs/Likely Typos/ExprHasNoEffect.ql

View File

@@ -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;
}