2 ms·
It will compile, and eventually blow up nicely with a stack overflow OS fault. Ah, the joys of writing "portable" C code with #ifdef spaghetti, across commerci
by pjmlp 2y ago
It will compile, and eventually blow up nicely with a stack overflow OS fault.
Ah, the joys of writing "portable" C code with #ifdef spaghetti, across commercial UNIXes and their own C compilers, 20 years ago.
It only got better because for many people just like they assume Web == Chrome, C gets C == GCC, blessifully ignoring everything else.
Nowadays clang is also considered, mostly because a couple of companies wanted to replace GCC, and naturally clang needs to be able to match whatever GCC offers.
- Filligree 2y ago> It will compile, and eventually blow up nicely with a stack overflow OS fault. Not at all guaranteed. Stack overflow is undefined behaviour, which means compilers can optimise your program on the assumption that it doesn’t happen.
- pjmlp 2y agoAh true, yet another case that one tends to forget about.
- flohofwoe 2y agoWell, if you use recursive code, you better know what you're doing. With or without tail call optimization.
- eru 2y agoLoops are just a special, limited case of recursion. (And only necessary in languages that have trouble implementing function calls properly.)