gcc/testsuite/c-c++-common/analyzer/uninit-pr106204.c
raw| 1 | /* { dg-additional-options "-ftrivial-auto-var-init=zero" } */ |
| 2 | |
| 3 | int foo(unsigned *len); |
| 4 | |
| 5 | /* Modified version of reproducer that does use "len" before init. */ |
| 6 | |
| 7 | int test_2() |
| 8 | { |
| 9 | unsigned len; |
| 10 | int rc; |
| 11 | |
| 12 | rc = len; /* { dg-warning "use of uninitialized value 'len'" } */ |
| 13 | rc = foo(&len); |
| 14 | if (!rc) |
| 15 | rc = len; |
| 16 | return rc; |
| 17 | } |