Re:Show HN: Smart pointers for the C programming language
by Snaipe on Thursday January 15, 2015 @09:36AM
(#8892633)
Not tested, but since longjmp has __attribute__ ((noreturn)), it should.
[ Parent
| on HN ]
Re:Show HN: Smart pointers for the C programming language
by aidenn0 on Thursday January 15, 2015 @12:28PM
(#8893867)
ah, it uses function attributes to do that; nice.
[edit] What about:
fn A calls setjmp, calls...
...fn B allocates, calls...
...fn C which may or may not longjmp (so not marked noreturn).
Re:Show HN: Smart pointers for the C programming language
by Snaipe on Thursday January 15, 2015 @03:09PM
(#8895013)
If a function may or may not return, and it is not marked for inlining, even gcc cannot infer whenever the variable exits the scope, so no.
You have to be extra careful anyways when using context switches.