gcc/testsuite/gcc.dg/uninit-pr106881.c
raw| 1 | /* { dg-do compile } */ |
| 2 | /* { dg-options "-O -fexceptions -Wuninitialized" } */ |
| 3 | |
| 4 | void l_free (void *); |
| 5 | char *l_settings_get_string (); |
| 6 | void eap_append_secret (); |
| 7 | inline void auto_free(void *a) { |
| 8 | void **p = a; |
| 9 | l_free(*p); /* { dg-warning "uninitialized" } */ |
| 10 | } |
| 11 | void eap_gtc_check_settings() { |
| 12 | char *identity __attribute__((cleanup(auto_free))); |
| 13 | char password __attribute__((cleanup(auto_free))); |
| 14 | identity = l_settings_get_string(); |
| 15 | eap_append_secret(); |
| 16 | } |