Kelsey Bjarnason wrote:
>
> On Wed, 27 Feb 2008 23:58:19 -0500, CBFalconer wrote:
>
> > Kelsey Bjarnason wrote:
> >> Or is this just another case where consistency need not apply?
> >>
> >> I'm all for being consistent, of course. We'll start by gutting much
> >> of stdio and see what's left of the language when we're done.
> >
> > What portion of the standard library do you consider unimplementable on
> > many systems?
>
> Me? Not sure. Some folks, however, seem to think there's a problem, so
> they created this weird little notion of a "freestanding implementation",
> one which isn't required to support largish portions of the standard
> library, apparently due to some weird view that, oh, fopen and its kin
> aren't really implementable on a Coke machine or an ABS control system.
> You know, systems where C can run.
My sarcasm detector winked at me, then went dark - so I'm not
quite sure how to interpret your comment. I guess I'll respond by
saying that the folks who wrote the standard made a serious
attempt to maximize reasonableness and minimize all tendancies to
allow their geekishness to wax pathological.
>
> Hence the comment: if "all" is the byword, why are these systems given an
> "out"? Last I checked, they qualified as part of "all". So do we remove
> the nonsense about freestanding implementations, under the argument that
> a function must be implementable by _all_ systems capable of running C
> (and thus making freestanding implementations irrelevant; they either
> _can_ support every function, or they cannot run C), or do we scrap the
> notion of "all", admitting that some things really aren't supportable on
> all systems capable of running C? If the latter, the argument provided
> against the non-busy-wait fails. Or do we scrap the bits of the standard
> which aren't implementable?
Neither. What we do is to lean back in our chair and consider the
bad old days when we wrote embedded code in assembly languages,
then we nod in Brian and Dennis' general direction, and we take
pleasure in having a tool that allows us to be satisfyingly
productive in a wide variety of hardware environments.
I've always preferred to write/draw with a sharp pencil - but
somewhen (it might've been about the time I was learning to
write) I discovered that if I put too fine a point on the lead,
the tip would break off as soon as it was applied to paper. By
third grade I'd learned how fine the point could be so as not to
break at first use.
It's almost painful to watch you attempt to oversharpen this
tool...
> Which functions, though? Hmm. Good question. Can a C program be
> implemented on a ROM? If so, we might have to eliminate memset, memcpy,
> strcpy, strcat and the like, as these won't - can't - function as
> expected. Hard to to a memset when the memory you're trying to write is
> read-only.
You remind me of a skit that appeared regularly on an old TV
program called "Hee-Haw!" - a thououghly blond gal walks into a
doctor's office, raises her arm about halfway, and says: "Doctor,
Doctor, it hurts when I do this!" and the doctor invariably
replied: "Well, don't do that!" as he chased her out of his
office.
A psychiatrist might be more interested (than would be a
programmer) in hearing about _why_ you're determined to memset()
a read-only space...
> Just a start. I'm sure a little clever thinking will find many more
> functions which cannot be implemented on *all* systems capable of running
> C.
Sir, please step away from the pencil sharpener...
:-]
--
Morris Dovey
DeSoto Solar
DeSoto, Iowa USA
http://www.iedu.com/DeSoto