OT: Requesting C advice

Michael Hennebry hennebry at web.cs.ndsu.nodak.edu
Fri May 25 20:06:28 UTC 2007


On Thu, 24 May 2007, Mike McCarty wrote:

> Matthew Saltzman wrote:
> > On Thu, 24 May 2007, Mike McCarty wrote:
> >
>
> [snip]
>
> >>> developed.  In any case, I don't know of any modern machine that
> >>> doesn't represent negative integers in two's complement.
> >>
> >>
> >> Reach into your pocket, and pull out your calculator.
> >
> >
> > Fair enough.  I'll concede the point if you can name a
> > standard-conforming C compiler for my calculator.

The calculator was probably programmed with a cros-compiler.
It wouldn't surprise me if the compiler derived from gcc.
The calculator's processor probably doesn't use decimal natively.
If it does use decimal natively,
one could still write a comforming compiler for it.
Doing so might be more interesting than one would like.

> The Standard does not say what size a byte is. CHAR_BIT defines that.
> It is possible for a conforming implementation to have CHAR_BIT to
> be 64. A byte does not have to be the smallest independently addressable
> unit greater than a bit on the underlying architecture, but it does have
> to be the smallest unit to which the implementation provides
> addressability which is greater than a bit.

I want to emphasize: *the implementation* .

The implementation could have CHAR_BITS=13 or 67 on pretty
much any given machine, not sensibly, but it could.
Another poster mentioned a compiler that
had char size as a compiler-time option.
The implementation could provide CHAR_BITS=13 and CHAR_BITS=67.

-- 
Mike   hennebry at web.cs.ndsu.NoDak.edu
"Horse guts never lie."  -- Cherek Bear-Shoulders




More information about the fedora-list mailing list