NULL is better than "anything else". The reason to set a variable to a consistent invalid value is that then the code fails consistently. Consistent bugs are much easier to track down.
Posted Dec 21, 2012 5:29 UTC (Fri) by nevets (subscriber, #11875)
[Link]
No, NULL may be better than uninitialized_var(), but it is not better than hiding gcc from warning about it.
Yes, a NULL pointer is easy to debug after a crash, but if it requires a tight race to get to a point where NULL will crash, that means you wont detect the bug until the crash happens. If that crash happens while on a production system, it's still a major issue.
My point is that uninitialized_var() isn't very good because it may hide bugs, but so is blindly initializing something, even with NULL. It's still hiding a bug.