Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions cpp/ql/lib/change-notes/2026-04-07-autoconf.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
category: feature
---
* Added a subclass `AutoconfConfigureTestFile` of `ConfigurationTestFile` that represents files created by GNU autoconf configure scripts to test the build configuration.
7 changes: 7 additions & 0 deletions cpp/ql/lib/semmle/code/cpp/ConfigurationTestFile.qll
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,10 @@ class MesonPrivateTestFile extends ConfigurationTestFile {
)
}
}

/**
* A file created by a GNU autoconf configure script to test the system configuration.
*/
class AutoconfConfigureTestFile extends ConfigurationTestFile {
AutoconfConfigureTestFile() { this.getBaseName().regexpMatch("conftest[0-9]*\\.c(pp)?") }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
| conftest.c.c:4:3:4:8 | call to strlen | This expression has no effect (because $@ has no external side effects). | conftest.h:3:8:3:13 | strlen | strlen |
| conftest_abc.c:4:3:4:8 | call to strlen | This expression has no effect (because $@ has no external side effects). | conftest.h:3:8:3:13 | strlen | strlen |
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,6 @@
#include "conftest.h"

int main2() {
strlen(""); // GOOD: the source file occurs in a `CMakeFiles/CMakeScratch/TryCompile-...` directory
Comment thread
jketema marked this conversation as resolved.
Outdated
return 0;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#include "conftest.h"

int main3() {
strlen(""); // GOOD: the source file occurs in a `CMakeFiles/CMakeScratch/TryCompile-...` directory
Comment thread
jketema marked this conversation as resolved.
Outdated
return 0;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#include "conftest.h"

int main4() {
strlen(""); // GOOD: the source file occurs in a `CMakeFiles/CMakeScratch/TryCompile-...` directory
Comment thread
jketema marked this conversation as resolved.
Outdated
return 0;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
typedef long long size_t;

size_t strlen(const char *s);
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#include "conftest.h"

int main5() {
strlen(""); // GOOD: the source file occurs in a `CMakeFiles/CMakeScratch/TryCompile-...` directory
Comment thread
jketema marked this conversation as resolved.
Outdated
return 0;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#include "conftest.h"

int main1() {
strlen(""); // GOOD: the source file occurs in a `CMakeFiles/CMakeScratch/TryCompile-...` directory
Comment thread
jketema marked this conversation as resolved.
Outdated
return 0;
}
Loading