Subject: Re: port-xen/29887: sysctl kern.consdev coredumps
To: James Chacon <jmc@NetBSD.org>
From: Greywolf <greywolf@starwolf.com>
List: netbsd-bugs
Date: 06/17/2005 12:49:00
[Thus spake James Chacon ("JC: ") 1:20pm...]
JC: The bug you cite doesn't discuss that. It's simply noting that
JC: printf("%s", NULL) is undefined behavior so basically they're allowed
JC: to core dump there even on translations to puts().
This is confusing: Why does printf("%s", NULL) attempt to translate
into puts() (or am I misreading something here)?
I can see it doing so on literals with no formatting...
If printf() with a NULL dumps core, AND f?puts() with a NULL dumps core,
well, this is certainly no different than it was when I was programming
for my CS class.
I also don't see what "(null)" really buys, as more often than not I run
into dereferencing objects which don't point to NULL, but rather to
someplace in West Hyperspace. I guess it's good for catching the id[10].t
cases where one forgets to assign/test values of pointers (although vars
in subroutines are not guaranteed to be initialised to zero...hence my
comment...).
Sorry for distracting.
--*greywolf;
--