Correct a possible oversight in the Warning 529 and/or 438 behavior
If a character array is set to a value (using a function), which is never subsequently used or returned the WARNING 529 or WARNING 438 should be generated.
Given the following file, main.c
1 #include <string.h>
2
3 int main ( void )
4 {
5 int un1 = 0;
6 char un2[10] = {0};
7 char un3[10] = {0};
8
9
10 strcpy(un2,"Hello");
11
12 return 0;
13 }
flexelint does not see the variable as unused below. Notice that Line 5 and Line 7 generate the 529, but line 6 is ignored. A 438 might work as well.
$ flint co-gcc.lnt main.c
FlexeLint for C/C++ (Unix) Vers. 9.00k2, Copyright Gimpel Software 1985-2013
--- Module: main.c (C)
_
return 0;
main.c 12 Warning 438: Last value assigned to variable 'un1' (defined at line
5) not used
main.c 5 Info 830: Location cited in prior message
_
}
main.c 13 Warning 529: Symbol 'un1' (line 5) not subsequently referenced
main.c 5 Info 830: Location cited in prior message
_
}
main.c 13 Warning 529: Symbol 'un3' (line 7) not subsequently referenced
main.c 7 Info 830: Location cited in prior message