This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/19972] -Wreturn-local-addr misses return of local (nested) function pointer


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=19972

--- Comment #3 from Patrick Pelissier <patrick.pelissier at gmail dot com> ---
I have tested with GCC 7.1.0 the code of #0 (forget the function h, this was
only a reference) and the status is the same as described in #0.

For the following code,

int (*apply (int (*f) (const void *, const void *), void *a))(const void *)
{
  int g(const void * b) { return f(a,b); };
  return &g;
}

I get no warning for returning the nested function 'g'.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]