unreachable code: don't warn about empty statements
[smatch.git] / validation / sm_strlen2.c
blob3af86a6825f3a0af2d60380c79c088bdbaa2e7ee
1 int strlen(char *str);
2 int strcpy(char *str);
4 void func (char *input1, char *input2, char *input3)
6 char buf1[4];
7 char buf2[4];
8 char buf3[4];
10 if (strlen(input1) > 4)
11 return;
12 strcpy(buf1, input1);
14 if (10 > strlen(input2))
15 strcpy(buf2, input2);
17 if (strlen(input3) <= 4)
18 strcpy(buf3, input3);
21 * check-name: Smatch strlen test #2
22 * check-command: smatch sm_strlen2.c
24 * check-output-start
25 sm_strlen2.c:12 func() error: strcpy() 'input1' too large for 'buf1' (5 vs 4)
26 sm_strlen2.c:15 func() error: strcpy() 'input2' too large for 'buf2' (10 vs 4)
27 sm_strlen2.c:18 func() error: strcpy() 'input3' too large for 'buf3' (5 vs 4)
28 * check-output-end