Skip to content

C++: Add heuristic for GNU autoconf config files#21661

Merged
jketema merged 2 commits intogithub:mainfrom
jketema:autoconf
Apr 7, 2026
Merged

C++: Add heuristic for GNU autoconf config files#21661
jketema merged 2 commits intogithub:mainfrom
jketema:autoconf

Conversation

@jketema
Copy link
Copy Markdown
Contributor

@jketema jketema commented Apr 7, 2026

No description provided.

Copilot AI review requested due to automatic review settings April 7, 2026 08:44
@jketema jketema requested a review from a team as a code owner April 7, 2026 08:44
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 AutoconfConfigureTestFile as a new ConfigurationTestFile subclass.
  • 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

Copy link
Copy Markdown
Contributor

@IdrissRio IdrissRio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍
Let's wait for DCA

@jketema
Copy link
Copy Markdown
Contributor Author

jketema commented Apr 7, 2026

DCA looks ok. This silences some of the conftest errors on nmap.

@jketema jketema merged commit e7d3eed into github:main Apr 7, 2026
19 checks passed
@jketema jketema deleted the autoconf branch April 7, 2026 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants