gcc/testsuite/gcc.dg/analyzer/pr101547.c
raw| 1 | char * |
| 2 | fopen (const char *restrict, const char *restrict); |
| 3 | |
| 4 | void |
| 5 | k2_uninit (void) |
| 6 | { |
| 7 | char *setfiles[1]; |
| 8 | int i; /* { dg-message "region created on stack here" } */ |
| 9 | |
| 10 | setfiles[i] = fopen ("", ""); /* { dg-warning "use of uninitialized value 'i'" } */ |
| 11 | } |
| 12 | |
| 13 | void |
| 14 | k2_leak (int i) |
| 15 | { |
| 16 | char *setfiles[1]; |
| 17 | |
| 18 | setfiles[i] = fopen ("", ""); |
| 19 | } /* { dg-warning "leak of FILE" } */ |