3 ms·
>>a printf that's inserted that causes a program to stop crashing. Huh?
by cryptide 14y ago
>>a printf that's inserted that causes a program to stop crashing.
Huh?
- salgernon 14y agoprintf can/does have side effects. Perhaps one of the parameters to the call is obscured by a macro, which has some other effect. Or perhaps stdout was redirected and the printf was required to prevent line buffering from hanging a downstream consumer. The point is, if it seems very unlikely that such and such could cause a problem, it probably isnt the true cause. (Printf itself isn't the fix, it is just involved in the fix)
- cryptide 14y agointeresting, thanks for the explanation.
- piotrSikora 14y agoprintf() introduces delay that is often enough to hide / "fix" race conditions.