Re: OT: Requesting C advice

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


Les wrote:
On Thu, 2007-05-24 at 11:38 +0100, Alan Cox wrote:

The DEC KAL10 stored 5 characters in a 36 bit word with one bit
left over for anything you wanted to do with it! It used 7 bit ASCII,
of course.

Or 6 BCD characters or 4 8 (as 9) bit ASCII values. Ditto the Honeywell
L66. Character width as a compile option.

Be very glad that today you don't have to fight that kind of thing. Don't
however assume in portable code that int is 32bits, long is 32bits,
pointers are 32bits and so on. C99 has proper types when you need to be

Also be aware that some Linux ports have char as unsigned by default and
others as signed.

Hi, Alan,
    I haven't seen a signed char since the 80's.  I did run into it once
on I think a ColecoVision package (don't ask!).

$ cat char.c
#include <stdio.h>

int     main(void) {
    char    Chr;

    Chr = -1;
    return 0;

$ gcc -o char char.c
$ ./char
$ uname -a
Linux Presario-1 2.6.10-1.771_FC2 #1 Mon Mar 28 00:50:14 EST 2005 i686 i686 i386 GNU/Linux

So, on FC2, char is signed by default. I suspect that to be true
for all the Fedora Core releases.

    That would really mess up any algorithm parsing into memory, and
would make dealing with solving some kinds of memory issues very
difficult, I would think, although

I suspect you are conflating "signed char" with "a character in the
execution environment which, when its code is stored into a signed char,
results in a negative value."

Oppose globalization and One World Governments like the UN.
This message made from 100% recycled bits.
You have found the bank of Larn.
I can explain it for you, but I can't understand it for you.
I speak only for myself, and I am unanimous in that!

[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux