4 ms·
Mostly for the usual "don't reinvent a wheel the language standard library already provides" reasons, I think. For instance glibc's x86setjmp/sigsetjmp have bee
by pm215 4y ago
Mostly for the usual "don't reinvent a wheel the language standard library already provides" reasons, I think. For instance glibc's x86setjmp/sigsetjmp have been updated to support shadow stacks, but if you'd rolled your own you'd have to do that yourself:
https://elixir.bootlin.com/glibc/glibc-2.35/source/sysdeps/i386/setjmp.S https://elixir.bootlin.com/glibc/glibc-2.35/source/sysdeps/i...
- j16sdiz 4y agoYes, but the author was trying to avoid using libc. > Yesterday I wrote that setjmp is handy and that it would be nice to have without linking the C standard library. Related article from the same author. https://nullprogram.com/blog/2023/02/11/ https://nullprogram.com/blog/2023/02/11/
- pm215 4y agoPersonally I think that's throwing the baby out with the bathwater for most use cases. You could rephrase my comment as "if you're already committed to reinventing half of libc's wheels, this one is not really any harder or more awkward than most, but if you're not aiming for that overall goal then reinventing just this one wheel is a bad plan" if you like.