gcc/testsuite/c-c++-common/analyzer/fd-uninit-1.c
raw| 1 | /* Verify that we check for uninitialized values passed to functions |
| 2 | that we have special-cased state-machine handling for. */ |
| 3 | |
| 4 | int dup (int old_fd); |
| 5 | int not_dup (int old_fd); |
| 6 | |
| 7 | int |
| 8 | test_1 () |
| 9 | { |
| 10 | int m; |
| 11 | return dup (m); /* { dg-warning "use of uninitialized value 'm'" "uninit" } */ |
| 12 | } |
| 13 | |
| 14 | int |
| 15 | test_2 () |
| 16 | { |
| 17 | int m; |
| 18 | return not_dup (m); /* { dg-warning "use of uninitialized value 'm'" } */ |
| 19 | } |