3 ms·
Printf is fine until you have to deal with the "f". Some compilers can keep format strings type-safe, but they are going above and beyond the standard to make
by Dylan16807 3y ago
Printf is fine until you have to deal with the "f".
Some compilers can keep format strings type-safe, but they are going above and beyond the standard to make it happen.
- tristan957 3y agoIf you are using a compiler that doesn't support this, developer tooling like clangd and clang-tidy can help catch these issues too.
- Dylan16807 3y agoToday, yes. But it's relevant for a claim that C had it right "all along".
- LordShredda 3y agoMaybe this should've been something built in if automated tooling can catch it?
- kazinator 3y ago> above and beyond the standard That's a very low bar though. There are widely used languages that don't have a standard at all; literally every single thing you can do in them is above and beyond any sort of standard.
- Dylan16807 3y agoFew of those languages corrupt the stack when you print wrong.