gcc/testsuite/c-c++-common/analyzer/pr94047.c
raw| 1 | typedef struct list |
| 2 | { |
| 3 | struct list *next; |
| 4 | } tlist; |
| 5 | |
| 6 | void |
| 7 | bar (struct list *l) |
| 8 | { |
| 9 | l->next = l->next->next; |
| 10 | } |
| 11 | |
| 12 | void |
| 13 | foo (void) |
| 14 | { |
| 15 | struct list l; /* { dg-message "region created on stack here" } */ |
| 16 | tlist t = l; /* { dg-warning "use of uninitialized value 'l'" } */ |
| 17 | for (;;) |
| 18 | bar (&t); |
| 19 | } |