1/* GCC was not warning about taking the address of paramaters or 2 fields of struct paramaters when returning them. */ 3/* PR c/14156 */ 4 5/* { dg-do compile } */ 6 7 8int * f( int a) 9{ 10 return &a;/* { dg-warning "address" "" } */ 11} 12 13int * g() 14{ 15 int b = 0; 16 return &b;/* { dg-warning "address" "" } */ 17} 18 19struct ll 20{ 21 int i; 22}; 23 24int *h(struct ll c) 25{ 26 return &c.i;/* { dg-warning "address" "" } */ 27} 28 29 30struct ll d; 31 32int *i() 33{ 34 return &d.i;/* { dg-bogus "address" "" } */ 35} 36 37 38int *j(struct ll *c) 39{ 40 return &c->i; /* { dg-bogus "address" "" } */ 41} 42