4 ms·
GCC has a pure attribute for functions which is documented as being prohibitive of impure behavior. Though, I honestly cannot say how thoroughly it is enforced
by HybridCurve 4y ago
GCC has a pure attribute for functions which is documented as being prohibitive of impure behavior. Though, I honestly cannot say how thoroughly it is enforced or if there are significant benefits outside of the obvious and some minor optimizations which the compiler might be able to perform.
- leni536 4y agoIt's not enforced. It's a promise. If you mark a non-pure function pure, then you are going to have a bad time. I would also be reluctant to mark any function pure that takes pointers as arguments (directly or indirectly).