Subject: Re: port-xen/29887: sysctl kern.consdev coredumps
To: None <>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: tech-userlevel
Date: 06/17/2005 21:57:40
>> I call it a bug not in the sense of "it's forbidden to do that" but
>> rather in the sense of "the compiler should be *useful*, not do
>> everything it is possibly allowed to by the spec to surprise people".
> The only reason it is "surprising" you is because you are relying on
> behavior that is specifically described as "undefined" by the
> standard.

No, I am relying on behaviour the standard is completely silent on,
because it is outside the standard's scope - namely, that the operation
spelled "printf" in source code is implemented by calling a function of
that name in an implementation-specific library.

You still appear to think I'm talking about the change in the behaviour
when passed nil pointers.  I'm not.  I'm talking about calling the
"wrong" function _at all_, regardless of what it may do with any
particular arguments.

If I were to stick strictly to what the standard promises, I wouldn't
be hacking OS-level code at all; I'd be doing applications, and rather
boring applications at that.  Converting source that calls printf into
code that calls puts is within the compiler's rights from a C Standard
point of view, but is an exceptionally egregious violation of least
surprise from a Unix programmer's point of view.

/~\ The ASCII				der Mouse
\ / Ribbon Campaign
 X  Against HTML
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B