C++: Add heuristic for GNU autoconf config files#21661
Merged
jketema merged 2 commits intogithub:mainfrom Apr 7, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds detection for GNU autoconf-generated conftest* configuration test files so CodeQL C/C++ queries can exclude them (reducing noise), and introduces targeted regression tests.
Changes:
- Added
AutoconfConfigureTestFileas a newConfigurationTestFilesubclass. - Added ExprHasNoEffect query-test fixtures/expectations for autoconf-style
conftest*files. - Added a change note documenting the new heuristic.
Show a summary per file
| File | Description |
|---|---|
| cpp/ql/lib/semmle/code/cpp/ConfigurationTestFile.qll | Adds AutoconfConfigureTestFile to recognize autoconf conftest* files. |
| cpp/ql/lib/change-notes/2026-04-07-autoconf.md | Documents the new configuration-test-file heuristic. |
| cpp/ql/test/query-tests/Likely Bugs/Likely Typos/ExprHasNoEffect/autoconf/ExprHasNoEffect.qlref | Points the new autoconf test folder at the existing query. |
| cpp/ql/test/query-tests/Likely Bugs/Likely Typos/ExprHasNoEffect/autoconf/ExprHasNoEffect.expected | Asserts which autoconf fixtures should/shouldn’t be excluded. |
| cpp/ql/test/query-tests/Likely Bugs/Likely Typos/ExprHasNoEffect/autoconf/conftest.h | Shared header for the autoconf test fixtures. |
| cpp/ql/test/query-tests/Likely Bugs/Likely Typos/ExprHasNoEffect/autoconf/conftest.c | Autoconf fixture intended to be excluded by the heuristic. |
| cpp/ql/test/query-tests/Likely Bugs/Likely Typos/ExprHasNoEffect/autoconf/conftest.cpp | Autoconf fixture intended to be excluded by the heuristic. |
| cpp/ql/test/query-tests/Likely Bugs/Likely Typos/ExprHasNoEffect/autoconf/conftest123.c | Autoconf fixture intended to be excluded by the heuristic. |
| cpp/ql/test/query-tests/Likely Bugs/Likely Typos/ExprHasNoEffect/autoconf/conftest.c.c | Autoconf fixture intended not to match the heuristic (still flagged). |
| cpp/ql/test/query-tests/Likely Bugs/Likely Typos/ExprHasNoEffect/autoconf/conftest_abc.c | Autoconf fixture intended not to match the heuristic (still flagged). |
Copilot's findings
- Files reviewed: 10/10 changed files
- Comments generated: 5
cpp/ql/test/query-tests/Likely Bugs/Likely Typos/ExprHasNoEffect/autoconf/conftest.c.c
Outdated
Show resolved
Hide resolved
cpp/ql/test/query-tests/Likely Bugs/Likely Typos/ExprHasNoEffect/autoconf/conftest_abc.c
Outdated
Show resolved
Hide resolved
cpp/ql/test/query-tests/Likely Bugs/Likely Typos/ExprHasNoEffect/autoconf/conftest.c
Outdated
Show resolved
Hide resolved
cpp/ql/test/query-tests/Likely Bugs/Likely Typos/ExprHasNoEffect/autoconf/conftest.cpp
Outdated
Show resolved
Hide resolved
cpp/ql/test/query-tests/Likely Bugs/Likely Typos/ExprHasNoEffect/autoconf/conftest123.c
Outdated
Show resolved
Hide resolved
IdrissRio
approved these changes
Apr 7, 2026
Contributor
IdrissRio
left a comment
There was a problem hiding this comment.
LGTM 👍
Let's wait for DCA
Contributor
Author
|
DCA looks ok. This silences some of the conftest errors on nmap. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.