public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Bob Brose <linuxppcdev@qbjnet•com>
To: linuxppc-dev@ozlabs•org
Subject: Q: signed vs unsigned char, PPC vs x86 gcc 3.3.5 compiler differences
Date: 3 Oct 2005 02:11:29 -0000	[thread overview]
Message-ID: <20051003021129.20564.qmail@kunk.qbjnet.com> (raw)

I'm trying to fix some of the AX25 code in the 2.6 kernel and traced down
a problem to the use of a char var which was being assigned
the value of -1. On x86 when the var was compared to -1 it succeded but
on PPC it failed. So I tried a simple test:

main()
{
char atest;
atest=-1;
printf("%i,%X\n",atest,atest);
}

With GCC 3.3.5 on 2.6.14-rc1 x86 I get:
./atest
-1,FFFFFFFF

With GCC 3.3.5 on 2.6.14-rc1 PPC I get:
./atest
255,FF

If I change the declaration of atest to a signed char on PPC I get the
same result as x86.

Does this mean the char in x86 is signed and in PPC it's unsigned?
Has it always been thus?
 

             reply	other threads:[~2005-10-03  2:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-03  2:11 Bob Brose [this message]
2005-10-03  2:22 ` Q: signed vs unsigned char, PPC vs x86 gcc 3.3.5 compiler differences Hollis Blanchard
2005-10-03  5:07 ` Christopher Friesen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20051003021129.20564.qmail@kunk.qbjnet.com \
    --to=linuxppcdev@qbjnet$(echo .)com \
    --cc=linuxppc-dev@ozlabs$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox