-
Notifications
You must be signed in to change notification settings - Fork 1.9k
C++: Disable cpp/implicit-function-declaration on build mode none databases #21553
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
base: main
Are you sure you want to change the base?
Changes from all 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 | ||||
|---|---|---|---|---|---|---|
|
|
@@ -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. | ||||||
| */ | ||||||
|
|
||||||
| predicate locInfo(Locatable e, File file, int line, int col) { | ||||||
| e.getFile() = file and | ||||||
| e.getLocation().getStartLine() = line and | ||||||
|
|
@@ -39,6 +44,7 @@ predicate isCompiledAsC(File f) { | |||||
| from FunctionDeclarationEntry fdeIm, FunctionCall fc | ||||||
| where | ||||||
| isCompiledAsC(fdeIm.getFile()) and | ||||||
| not any(Compilation c).buildModeNone() and | ||||||
|
||||||
| not any(Compilation c).buildModeNone() and | |
| exists(Compilation c | not c.buildModeNone()) and |
| 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. |
There was a problem hiding this comment.
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
whereclause. After switching to anexists(...)-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.