Subject: Re: port-xen/29887: sysctl kern.consdev coredumps
To: None <port-xen-maintainer@netbsd.org, gnats-admin@netbsd.org,>
From: Greywolf <greywolf@starwolf.com>
List: netbsd-bugs
Date: 06/17/2005 16:43:02
The following reply was made to PR port-xen/29887; it has been noted by GNATS.

From: Greywolf <greywolf@starwolf.com>
To: Christos Zoulas <christos@zoulas.com>
Cc: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>, gnats-bugs@NetBSD.org,
	port-xen-maintainer@NetBSD.org, gnats-admin@NetBSD.org,
	netbsd-bugs@NetBSD.org, tech-userlevel@NetBSD.org
Subject: Re: port-xen/29887: sysctl kern.consdev coredumps
Date: Fri, 17 Jun 2005 09:42:00 -0700 (PDT)

 [Thus spake Christos Zoulas ("CZ: ") 9:25am...]
 
 CZ: I don't think so either, but when you ask the compiler to call printf(),
 CZ: and it calls puts() because it `knows' it is better, what else are you
 CZ: left with?
 
 It was once said that "programmers should avoid chumminess with the
 compiler."  Richie or Kernighan.  I think it applies in parallel to the
 compiler, in that the compiler should avoid chumminess with the programmer
 by "knowing" what would be more efficient in this situation, UNLESS THE
 PROGRAMMER EXPLICITLY REQUESTS SUCH OPTIMIZATION, say somewhere around
 -O9 (IMO).
 
 CZ: I am fine with disabling the optimization, but as I said, it will make
 CZ: our compiler different. I would rather convince the gcc team to consider
 CZ: turning the bogus behavior off permanently.
 
 This egregious behaviour in a compiler is absurd; I think most any other
 standard of a language would classify such a compiler as "broken, not
 to be used until fixed, and to be fixed yesterday."
 
 To have puts/fputs spit out "(null)" would be a much better way to handle
 this than to dump core.  I don't think we should have to even cpp::#define
 this based on __gcc_version__ or whatever they call it these days -- when
 they fix the compiler, we revert the code.
 
 				--*greywolf;
 --