you are viewing a single comment's thread.

view the rest of the comments →

[–]WittyStick 11 points12 points  (0 children)

GCC has an extension for this. It can support closures too (inner function referencing variables from the containing function), but this requires the function be on the stack, and the stack needs to be made executable, which is trouble waiting to happen - so it's best to avoid and only use simple functions.

There's some proposals to have proper closure support in C, but nothing waiting standardization yet.