This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/19972] -Wreturn-local-addr misses return of local (nested) function pointer
- From: "patrick.pelissier at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 25 Jul 2017 17:26:48 +0000
- Subject: [Bug c/19972] -Wreturn-local-addr misses return of local (nested) function pointer
- Auto-submitted: auto-generated
- References: <bug-19972-4@http.gcc.gnu.org/bugzilla/>
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'.