Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Nested functions are not supported on MacOSX

Name: Anonymous 2006-01-03 17:24

You wanted a programming thread?


(This, by the way, refers to nested functions in C code. A gcc extension)

"gcc's implementation of nested functions involves placing code on the stack and then executing it. Stack execution is a common operation in malicious code, particularly as a side effect of buffer overflows. While the proper fix is of course to not make buffer overflows possible in the first place, disabling stack execution decreases the likelihood that a buffer overflow or other stack-smashing attack will be exploitable."

"In future releases of Mac OS X, we may disable stack execution. (Obviously we'll have to keep binary compatibility in mind when or if we do that.) Nested functions were disabled to help prepare for that change."

"As for whether nested functions will be re-enabled, if someone contributes a patch to GCC to change the nested function implementation to not rely on stack execution, presumably there'd be a chance they'd be re-enabled."


Are Apple evil or awesome for doing this? (discussion!)

How would you go about implementing nested functions without using stack execution? (technical challenge!)

Or we could go back to flaming Java.

Name: Anonymous 2011-07-29 13:49

>>38
nested functions needn't be always closures
What's the point of nested functions if they're not closures? Scoping sugar?

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List