3 ms·
GNU C supports nested functions as an extension. I use them for the exact reasons you mention.
by Gibbon1 8y ago
GNU C supports nested functions as an extension. I use them for the exact reasons you mention.
- favorited 8y agoThat extension results in executable stack memory, which is going to be a non-starter for many developers.
- Gibbon1 8y agoI believe that that only happens if you pass a nested function as a function pointer. Then gcc emits a trampoline. If you just call it from the enclosing function it's fine.