Likelihood That (CHAR_BIT == 8).
  Home FAQ Contact Sign in
comp.lang.c++.moderated only
 
Advanced search
POPULAR GROUPS

more...

comp.lang.c++.moderated Profile…
 Up
Likelihood That (CHAR_BIT == 8).         


Author: Le Chaud Lapin
Date: May 9, 2008 19:31

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. :)

TIA,

-Le Chaud Lapin-

--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
6 Comments
Re: Likelihood That (CHAR_BIT == 8).         


Author: peter koch larsen
Date: May 10, 2008 04:04

On 10 Maj, 05:23, Le Chaud Lapin gmail.com> 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. :)

Probably a lot of CPU's have CHAR_BIT = 16 or 32. If you plan for
porting your code to e.g. cellphones and PDAs you are likely to get
into troubles (I've programmed on a PDA that had CHAR_BIT = 16).
If you turn into more exotic architectures you are of course even more
likely to experience problems.

/Peter
Show full article (1.02Kb)
no comments
Re: Likelihood That (CHAR_BIT == 8).         


Author: Pavel Minaev
Date: May 10, 2008 04:05

On 10 ???, 07:23, Le Chaud Lapin gmail.com> 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.

Likelihood depends on what you are targeting. But, to give a few
specific examples - some DSPs cannot operate on individual octets, so
char is whatever the word size of the architecture is - e.g. 32-bit.
There was a link to documentation for a C++ compiler for such a
platform (SHARC) given earlier in a thread titled "mixed-sign
arithmetic and auto" (which I would recommend to read, by the way - it
has some more information somewhat relevant to the topic) - here it
is:

http://www.analog.com/UploadedFiles/Associated_Docs/75285036450_SHARC_cc_man.pdf
Show full article (1.21Kb)
no comments
Re: Likelihood That (CHAR_BIT == 8).         


Author: John Nagle
Date: May 10, 2008 04:21

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.
Show full article (1.37Kb)
no comments
Re: Likelihood That (CHAR_BIT == 8).         


Author: Thomas Richter
Date: May 10, 2008 13:06

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.

Some TI DSPs have CHAR_BIT==16.

So long,
Thomas

--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
no comments
Re: Likelihood That (CHAR_BIT == 8).         


Author: Bart van Ingen Schenau
Date: May 10, 2008 13:13

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.

I am currently developing software for the BlueCore-5 chip (a Bluetooth
chip from Cambridge Silicon Radio, www.csr.com) which has CHAR_BIT ==
16.
>
> 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.

The communication might not be a problem for the BlueCore chip. It often
uses octet-oriented communication mechanisms (UART and I2C) and handles
the conversion between byte and octet internally.
Other processors that often interface over octet-oriented mechanisms
might do the same.
Show full article (1.31Kb)
no comments
Re: Likelihood That (CHAR_BIT == 8).         


Author: Alan McKenney
Date: May 11, 2008 07:50

On May 10, 8:14 am, John Nagle animats.com> wrote:

> 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.

Has production of supercomputers ended, too?

Supercomputers generally don't have (hardware) access
for units smaller than one word, for efficiency reasons.
E.g., CDC 6600/7600 series, Crays, etc.

I used to run C++ programs on supercomputers, and there
is a subgroup of the C++ standards group interested in
C++ for numerical applications, so they are
relevant to this group.
> So you probably don't have to support char sizes other than 8.
Show full article (1.74Kb)
no comments

RELATED THREADS
SubjectArticles qty Group
Re: [PATCH (incomplete)] Make regcomp use SV* sv, instead of char* exp, char* xendperl.perl5.porters ·
Bug#475919: lcms_1.16-8+b1(sparc/unstable): FTBFS: invalid conversion from 'const char*' to 'char*'linux.debian.bugs.rc ·