Skip to content

Commit 4825774

Browse files
Add missing file changed
1 parent 7f6b32d commit 4825774

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

c/cert/src/rules/DCL40-C/IncompatibleFunctionDeclarations.ql

+10-2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ import codingstandards.c.cert
1919
import codingstandards.cpp.types.Compatible
2020
import ExternalIdentifiers
2121

22+
predicate interestedInFunctions(FunctionDeclarationEntry f1, FunctionDeclarationEntry f2) {
23+
not f1 = f2 and
24+
f1.getDeclaration() = f2.getDeclaration() and
25+
f1.getName() = f2.getName()
26+
}
27+
2228
from ExternalIdentifiers d, FunctionDeclarationEntry f1, FunctionDeclarationEntry f2
2329
where
2430
not isExcluded(f1, Declarations2Package::incompatibleFunctionDeclarationsQuery()) and
@@ -29,10 +35,12 @@ where
2935
f1.getName() = f2.getName() and
3036
(
3137
//return type check
32-
not FunctionDeclarationTypeEquivalence<TypesCompatibleConfig>::equalReturnTypes(f1, f2)
38+
not FunctionDeclarationTypeEquivalence<TypesCompatibleConfig, interestedInFunctions/2>::equalReturnTypes(f1,
39+
f2)
3340
or
3441
//parameter type check
35-
not FunctionDeclarationTypeEquivalence<TypesCompatibleConfig>::equalParameterTypes(f1, f2)
42+
not FunctionDeclarationTypeEquivalence<TypesCompatibleConfig, interestedInFunctions/2>::equalParameterTypes(f1,
43+
f2)
3644
) and
3745
// Apply ordering on start line, trying to avoid the optimiser applying this join too early
3846
// in the pipeline

0 commit comments

Comments
 (0)