3 ms·
There are two kinds of C programmers. - folks who haven't seen Duff's device - folks who understand Duff's device Seriously, I was waiting for this articl
by klyrs 6y ago
There are two kinds of C programmers.
- folks who haven't seen Duff's device
- folks who understand Duff's device
Seriously, I was waiting for this article to do something evil but... maybe I'm a horrible person but none of the examples were too bad.
- a1369209993 6y agoWell, the ones involving gotoing into halfway through the evaluation of a expression were bad in that they don't work, or appear to work due to coincidence but will break if slightly perturbed, but they're not hard to understand.
- klyrs 6y agoTo be fair, that's gcc, not C.
- a1369209993 6y agoNo, that's clang/llvm; gcc handles this correctly (at least by the extremely low standards of gcc/llvm handling of undefined behaviour): $ gcc test.c test.c:3:5: error: jump into statement expression