Skip to content

Commit 20c1f72

Browse files
authored
Merge pull request #457 from jketema/prototype
Use new `isPrototyped` predicate in RULE-8-2
2 parents 7db8a89 + faf222e commit 20c1f72

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

c/misra/src/rules/RULE-8-2/FunctionTypesNotInPrototypeForm.ql

+4-6
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,9 @@ where
4848
msg = "Function " + f + " does not specify void for no parameters present."
4949
or
5050
//parameters declared in declaration list (not in function signature)
51-
//have placeholder file location associated only
52-
exists(Parameter p |
53-
p.getFunction() = f and
54-
not p.getFile() = f.getFile() and
55-
msg = "Function " + f + " declares parameter in unsupported declaration list."
56-
)
51+
//have no prototype
52+
not f.isPrototyped() and
53+
not hasZeroParamDecl(f) and
54+
msg = "Function " + f + " declares parameter in unsupported declaration list."
5755
)
5856
select f, msg

0 commit comments

Comments
 (0)