Squelch bminor/bash alerts and set query precision to high.

This commit is contained in:
Ziemowit Laski
2019-07-06 14:27:02 -07:00
parent 9e600e3768
commit be0db66a55
2 changed files with 12 additions and 1 deletions

View File

@@ -34,6 +34,7 @@ predicate isCompiledAsC(Function f) {
from FunctionCall fc, Function f
where
f = fc.getTarget() and
f.getNumberOfParameters() = 0 and
not f.isVarargs() and
hasZeroParamDecl(f) and
isCompiledAsC(f) and

View File

@@ -38,7 +38,7 @@ void test(int *argv[]) {
int x;
declared_empty_defined_with(&x); // BAD
declared_empty_defined_with(3, &x); // BAD
declared_empty_defined_with(3, &x); // BAD [NOT DETECTED]
not_declared_defined_with(-1, 0, 2U); // GOOD
not_declared_defined_with(4LL, 0, 2.5e9f); // BAD
@@ -114,3 +114,13 @@ unsigned int defined_with_ptr_arr(unsigned int *ptr[]) {
void declared_and_defined_empty() {
return;
}
extern int will_be_k_and_r();
int call_k_and_r(int i) {
return will_be_k_and_r(i); // GOOD
}
int will_be_k_and_r(val)
int val;
{ return val + 1; }