Le Chaud Lapin wrote:
> Hi All,
>
> I would like to know of existing systems where CHAR_BIT of
> is not equal to 8. I am particular interested in prevalent systems.
>
> Technically, my code is mostly portable, but only within a particular
> machine. Innter-machine interaction (serialization for example), there
> will be problems for those machines where CHAR_BIT != 8.
>
> Yes, yes, I know, it enough effort, I can rewrite my code to eliminate
> any potential compatibilities even then, but still, it helps to
> know. :)
There are still a few 36-bit DEC machines running
(try Telnet to "
DEC-10.PDPplanet.COM") and some Unisys
B series mainframes running 36-bit OS/2200. But when Unisys
discontinued the ClearPath 36-bit server line last year, in favor of software
emulation of the 36-bit machines for old code, commercial production of the
last non-byte-oriented hardware ended.
So you probably don't have to support char sizes other than 8.
Here, for fun, is a useful piece of C code written to work portably across
7, 8, and 9-bit character sizes. This tests passwords for "obviousness"
without needing a dictionary file.
http://www.animats.com/source/obvious/obvious.c
John Nagle