param_cleared, rosenberg: add underscored memset/cpy/zero() functions
[smatch.git] / validation / sm_loops4.c
blob1b35b2131062ee39fbb3fbbde39a060da1e39791
1 #include "check_debug.h"
3 char *some_func(void);
5 int x,y;
6 int i;
7 void func(void)
9 char *p;
10 char *p2;
12 if (x > 0)
13 p = some_func();
14 for (i = 0; i < x; i++)
15 *p = 'x';
16 *p = 'x';
17 if (y > 0)
18 p2 = some_func();
19 i = 0;
20 if (i < y)
21 *p2 = 'x';
24 * check-name: smatch loops #4
25 * check-command: smatch -I.. sm_loops4.c
27 * check-output-start
28 sm_loops4.c:16 func() error: potentially dereferencing uninitialized 'p'.
29 * check-output-end