Subject: Re: port-xen/29887: sysctl kern.consdev coredumps
To: Christos Zoulas <>
From: Greywolf <>
List: tech-userlevel
Date: 06/17/2005 09:42:00
[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
-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.