Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ import TooFewArguments
import TooManyArguments
import semmle.code.cpp.commons.Exclusions

/*
* This query is not compatible with build mode: none databases, and has
* no results on those databases.
Comment on lines +21 to +22
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

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

The comment states unconditionally that the query “has no results” on build mode: none databases, but that guarantee depends on the correctness of the build-mode detection logic in the where clause. After switching to an exists(...)-style guard (see other comment), consider updating the wording slightly to describe the mechanism (e.g., “Results are suppressed on build mode: none databases”) to avoid overstating the behavior if the guard changes again later.

Suggested change
* This query is not compatible with build mode: none databases, and has
* no results on those databases.
* This query is not compatible with build mode: none databases; results
* are suppressed on such databases by the build-mode guard in the `where` clause.

Copilot uses AI. Check for mistakes.
*/

predicate locInfo(Locatable e, File file, int line, int col) {
e.getFile() = file and
e.getLocation().getStartLine() = line and
Expand All @@ -39,6 +44,7 @@ predicate isCompiledAsC(File f) {
from FunctionDeclarationEntry fdeIm, FunctionCall fc
where
isCompiledAsC(fdeIm.getFile()) and
not any(Compilation c).buildModeNone() and
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

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

any(Compilation c).buildModeNone()is an aggregation that can be ill-defined if there are noCompilationrows (which may be the case in build mode: none / buildless databases). In that scenario, this guard may not evaluate as intended, potentially failing to suppress results (or suppressing everything unexpectedly depending on QL semantics). Prefer a quantifier-based check that behaves correctly on empty sets, e.g.not exists(Compilation c | c.buildModeNone())` (or the project’s canonical “is build mode none” predicate if one exists).

Suggested change
not any(Compilation c).buildModeNone() and
exists(Compilation c | not c.buildModeNone()) and

Copilot uses AI. Check for mistakes.
not isFromMacroDefinition(fc) and
fdeIm.isImplicit() and
sameLocation(fdeIm, fc) and
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
category: minorAnalysis
---
* The "Implicit function declaration" (`cpp/implicit-function-declaration`) query no longer produces results on `build mode: none` databases. These results were found to be very noisy and fundamentally imprecise in this mode.
Loading