gcc/testsuite/c-c++-common/analyzer/pr102692-2.c
raw| 1 | /* { dg-additional-options "-O1" } */ |
| 2 | |
| 3 | struct Lisp_Overlay |
| 4 | { |
| 5 | struct Lisp_Overlay *next; |
| 6 | }; |
| 7 | |
| 8 | void |
| 9 | test_1 (struct Lisp_Overlay *tail, long prev) |
| 10 | { |
| 11 | long end; |
| 12 | if (!tail || end < prev || !tail->next) /* { dg-warning "use of uninitialized value 'end'" } */ |
| 13 | return; |
| 14 | } |
| 15 | |
| 16 | void |
| 17 | test_2 (struct Lisp_Overlay *tail, long prev) |
| 18 | { |
| 19 | long end; |
| 20 | if (tail && end < prev && !tail->next) /* { dg-warning "use of uninitialized value 'end'" } */ |
| 21 | return; |
| 22 | } |