3 ms·
Just wanted to mention that GNU C has supported nested functions since forever, it's one of the main reasons I prefer GCC over Clang these days.
by bgongfu 8y ago
Just wanted to mention that GNU C has supported nested functions since forever, it's one of the main reasons I prefer GCC over Clang these days.
- buserror 8y agoYes and it annoys me no end that clang has refused to implement them as well, as they were part of my codebase as well... How better to implement stuff like qsort() callbacks than with a simple, contextual small function just over it ?? YES it is dangerous due to stacks etc etc but hey, we're grown up adults, not script kiddies.
- basementcat 8y agoClang has Blocks instead of nested functions. There may be patches for gcc-4.2 for Blocks but they didn't make it to the mainline. https://en.wikipedia.org/wiki/Blocks_(C_language_extension) https://en.wikipedia.org/wiki/Blocks_(C_language_extension)
- pjmlp 8y ago> YES it is dangerous due to stacks etc etc but hey, we're grown up adults, not script kiddies. That is how CVEs are born.
- bgongfu 8y agoUsing a chainsaw without paying attention is how fingers are cut off, using that as an argument against making chainsaws easier to use doesn't make any kind of sense.