Subject: Re: port-xen/29887: sysctl kern.consdev coredumps
To: YAMAMOTO Takashi <>
From: James Chacon <>
List: tech-userlevel
Date: 06/17/2005 13:20:39
On Sat, Jun 18, 2005 at 03:04:10AM +0900, YAMAMOTO Takashi wrote:
> > I am fine with disabling the optimization, but as I said, it will make
> > our compiler different. I would rather convince the gcc team to consider
> > turning the bogus behavior off permanently.
> i agree that it's ideal to convince the gcc team.
> although i think it's difficult, reading the comment on the bug report.
> IMO, in this case, being different is fine.
> if a user installs a broken compiler by himself,
> he'll get a broken compiler.  there is no difference from
> the case of arbitrary broken software.

Being different is not fine if it changes gcc behavior. We don't provide
netbsd-cc on boxes. We provide something claiming to be "gcc". Therefore it
needs to behave as gcc does, warts and all. Any fix for us should be
in making puts deal w. NULL and marking it as XXGCC and then pursuing with
the gcc maintainers that printf->puts translations shouldn't happen unless
a user explicitly enables it with some -f option (ala not part of some -O).

The bug you cite doesn't discuss that. It's simply noting that 
printf("%s", NULL) is undefined behavior so basically they're allowed to core
dump there even on translations to puts().