getc and "large" bytes

F

Flash Gordon

Jack Klein wrote, On 24/05/08 03:56:

I just want to ask all of you a few questions:

1. How many of you have actually ever worked on an implementation
where CHAR_BIT was greater than 8? Show of hands, please.

/me puts up two hands, one for each implementation
2. How many of you have actually ever worked on a hosted
implementation where CHAR_BIT was greater than 8, that fully supported
binary streams?
No.

3. How many of you have even heard of hosted environments, with full
support for binary streams, where CHAR_BIT is greater than 8?

How about the 9bit machines people have mentioned in the past? Did they
have C implementations with binary streams fully supported?

A more pertinent question would be about implementations where
sizeof(int)==1, and I've not heard of any.
 
C

Chris Torek

How about the 9bit machines people have mentioned in the past? Did they
have C implementations with binary streams fully supported?

There was a C compiler for the Univac in the basement, back
when I was at the University of Maryland. The Univac had
9-bit char, 18-bit short, 36-bit long.

I never used it though (the C compiler, I mean -- I barely ever
used the Univac, except as required for a few courses). I expect
it worked pretty much the same way as other ASCII-based systems on
that machine: there was a file format using "quarterwords" (9-bit
"bytes"; the native Univac "bytes" were 6-bit FIELDATA text), and
in general people just avoided setting the topmost bit(s). If you
*did* set the topmost bits, you got non-ASCII data in your "ASCII"
files, and it would transfer OK as long as you stayed "inside" the
Univac system, but bits 7 and 8 would disappear in various kinds
of I/O (because "quarterword" data would get transferred in 7 or
8 bit units to external hardware that worked in "anything other
than FIELDATA").

Systems with wildly different internal and external data representations
*do* teach one to learn about "internalizing" and "externalizing"
data, at least. :)
 
L

lawrence.jones

Richard Tobin said:
Are all possible unsigned char values required to be characters that
can be written and read?

Yes.

-- Larry Jones

But Mom, frogs are our FRIENDS! -- Calvin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,263
Messages
2,571,062
Members
48,769
Latest member
Clifft

Latest Threads

Top