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'.