3 ms·
> This led to classic bugs where the function returns a pointer to a local value. Compilers now usually catch this. C eventually got structure return by copy. T
by zbentley 2y ago
> This led to classic bugs where the function returns a pointer to a local value. Compilers now usually catch this. C eventually got structure return by copy. Then C++ added return value by move, and automatic optimization for that.
Jesus Christ. Can we now get “return fruit by vegetable?”
Some speedups may not be worth having to memorize standards documents.
- Aeglaecia 2y agoprogrammers who get the job done without needing to memorise standards or dig into hardware specifics are surely happy enough with general optimisations applied by the compiler like tail call optimisation or copy elision ...
- binary132 2y agonot complicated stuff to understand, and doesn’t even need to be understood to use correctly. Just don’t return pointers to locals.