On Mon, Dec 04, 2023 at 05:39:04PM +0100, Andreas Schwab wrote: > On Dez 04 2023, Siddhesh Poyarekar wrote: > > > For hardened code in C, I think we really should look to step away from > > nested functions instead of adding ways to continue supporting it. There's > > probably a larger conversation to be had about the utility of nested > > functions in general for C (and whether this GCC extension should be > > deprecated altogether in future), but I feel like the -fhardened subset > > gives us the opportunity to enforce at least a safe subset for now, > > possibly extending it in future. > > Nested functions by itself don't need a trampoline, only if the address > of it is passed outside the containing function's scope (as a callback, > for example).
And only if the code to which it is passed can't be inlined back. I'm afraid contained functions in Fortran or in Ada (whatever it is called there) aren't going away any time soon and having the possibility to test it also in C and not just Fortran/Ada is very useful at least from compiler testing POV. Jakub