Structural-Test: Variable declaration in function parameter
If the variable is declared as a function parameter, it is not recognized. Should this behavior be changed?
Example:
functions:
- disallowed_keywords: [for, while, do]
function: fib
input: false
output: false
expected_variable_declarations:
- 'int n'
input: null
insecure: false
main_file: main_fun_var_decl_param_present.c
output: null
#include <stdio.h>
#include <stdlib.h>
int fib(int n) {
if(n == 0){
return 0;
} else if(n == 1) {
return 1;
} else {
return (fib(n-1) + fib(n-2));
}
}
int main(void) {
int n;
scanf("%d", &n);
printf("fib(n) = %d!\n", fib(n));
return EXIT_SUCCESS;
}