-
Notifications
You must be signed in to change notification settings - Fork 2k
C++: Add heuristics for meson configuration files #21618
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
|
|
||
| --- | ||
| category: feature | ||
| --- | ||
| * Added subclass `MesonPrivateTestFile` of `ConfigurationTestFile` that represents files created by Meson to test the build configuration. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A non-blocking question: I checked on Meson docs and I couldn't find anything about the naming of
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does the meson documentation mention anything about how it does this kind of stuff?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, I count'd find anything (from a quick search).
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Then I would say: this is what we've observed in practice, and this is the most specific we seem to be able to do, so we do that.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sounds good! Thanks |
||
| exists(Folder folder, Folder parent | | ||
| folder = this.getParentContainer() and | ||
| parent = folder.getParentContainer() | ||
| | | ||
| folder.getBaseName().matches("tmp%") and | ||
| parent.getBaseName() = "meson-private" | ||
| ) | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Likely Bugs/Likely Typos/ExprHasNoEffect.ql |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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; | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.