3 ms·
A little puzzle with printf() and C argument passing
- colejohnson66 6y agoIt’s a really neat exercise in understanding the ABI. I like it. If you’ve looked at the ABI for your platform, it’s already something you know, but I didn’t “get it” until I read the answer. Of course, there’s always the whole “this is undefined behavior; here be dragons” disclaimer along with the fact that a good compiler will warn (or error) on incorrect parameter order.
- MaxBarraclough 6y agoFortunately modern C compilers are pretty good at warning about such mistakes with printf.