Terry Lambert [EMAIL PROTECTED] wrote:
Thomas David Rivers wrote:
Well - it's not counter-intuitive on many machines... For example,
on the IBM mainframe - there is an instruction to load a character
into a register - but not one that loads *and* sign-extends. So,
you can get much
[CC: obrien, who has been working on bringing in gcc 3.1]
At Wed, 15 May 2002 20:46:06 -0700,
Bill Fenner wrote:
So - yes - it seems gcc 3.1 does have a problem...
Indeed - easily determined by breaking down the expression.
So, who's gonna report it to gcc-bugs? knu?...
int
main()
On Thu, 16 May 2002, Akinori MUSHA wrote:
[CC: obrien, who has been working on bringing in gcc 3.1]
At Wed, 15 May 2002 20:46:06 -0700,
Bill Fenner wrote:
So, who's gonna report it to gcc-bugs? knu?...
int
main()
{
unsigned char i = 127;
char j;
printf(%d\n,
I've submitted a bug report to GCC GNATS:
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?database=gccpr=6677cmd=view+audit-trail
Let's see how they handle this.
--
/
/__ __Akinori.org / MUSHA.org
/ ) ) ) ) / FreeBSD.org /
On Thu, May 16, 2002 at 08:31:19PM +0900, Akinori MUSHA wrote:
So - yes - it seems gcc 3.1 does have a problem...
Indeed - easily determined by breaking down the expression.
So, who's gonna report it to gcc-bugs? knu?...
Specifically what is the problem? Given the program below, take
Specifically what is the problem? Given the program below, take the
ISO-C spec and explain the problem. Or even w/o the spec -- I haven't
been reading this thread.
int
main()
{
unsigned char i = 127;
char j;
printf(%d\n, ((char)(i 1)));
This prints -2, which is
On Thu, May 16, 2002 at 12:06:49PM -0700, Bill Fenner wrote:
Specifically what is the problem? Given the program below, take the
ISO-C spec and explain the problem. Or even w/o the spec -- I haven't
been reading this thread.
int
main()
{
unsigned char i = 127;
char j;
On Thu, May 16, 2002 at 06:47:39AM -0400, Thomas David Rivers wrote:
Terry Lambert [EMAIL PROTECTED] wrote:
RS/6000's didn't used to use PPC processors at all; so it's
probably intentional software compatability.
I'm confused then - the one we have here seems to. There
was a version
I observed gcc 2.95.4 and gcc 3.1 interpret (or maybe optimize) the
following code differently (CFLAGS=-O):
int main(void)
{
unsigned char i = 127;
printf(%d\n, ((char)(i 1)) / 2);
return 0;
}
gcc 2.95.4 says it's -1, whereas gcc 3.1 says it's 127. On FreeBSD
char should be signed, so I
Akinori MUSHA wrote:
I observed gcc 2.95.4 and gcc 3.1 interpret (or maybe optimize) the
following code differently (CFLAGS=-O):
int main(void)
{
unsigned char i = 127;
printf(%d\n, ((char)(i 1)) / 2);
return 0;
}
Cool...
gcc 2.95.4 says it's -1,
Promotion of operand to
gcc 3.1 simply defaults to unsigned chars. 127 1 = 254; 254 / 2 = 127.
My machine is too slow to test this expeditiously, but I'm trying
adding #define DEFAULT_SIGNED_CHAR 1 into freebsd-native.h .
Bill
To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the
On Thu, May 16, 2002 at 02:42:34AM +0900, Akinori MUSHA wrote:
I observed gcc 2.95.4 and gcc 3.1 interpret (or maybe optimize) the
following code differently (CFLAGS=-O):
int main(void)
{
unsigned char i = 127;
printf(%d\n, ((char)(i 1)) / 2);
return 0;
}
I think GCC 3.1 does a
Bill Fenner wrote:
gcc 3.1 simply defaults to unsigned chars. 127 1 = 254; 254 / 2 = 127.
My machine is too slow to test this expeditiously, but I'm trying
adding #define DEFAULT_SIGNED_CHAR 1 into freebsd-native.h .
I will bet today's lunch money that you have found it for sure.
I guess
Duh. Sometimes I wish I had the patience to wait for my tests to complete
before sharing my guesses. I jumped to a wildly incorrect conclusion; gcc
3.1 still defaults to signed chars. Sorry for the bizarre misdirection.
Bill
To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe
Bill Fenner wrote:
Duh. Sometimes I wish I had the patience to wait for my tests to complete
before sharing my guesses. I jumped to a wildly incorrect conclusion; gcc
3.1 still defaults to signed chars. Sorry for the bizarre misdirection.
There goes my lunch money. 8-(.
Man, your
I observed gcc 2.95.4 and gcc 3.1 interpret (or maybe optimize) the
following code differently (CFLAGS=-O):
int main(void)
{
unsigned char i = 127;
printf(%d\n, ((char)(i 1)) / 2);
return 0;
}
gcc 2.95.4 says it's -1, whereas gcc 3.1 says it's 127. On FreeBSD
char should
Terry Lambert [EMAIL PROTECTED] wrote:
Bill Fenner wrote:
gcc 3.1 simply defaults to unsigned chars. 127 1 = 254; 254 / 2 = 127.
My machine is too slow to test this expeditiously, but I'm trying
adding #define DEFAULT_SIGNED_CHAR 1 into freebsd-native.h .
I will bet today's lunch
So - yes - it seems gcc 3.1 does have a problem...
Indeed - easily determined by breaking down the expression.
So, who's gonna report it to gcc-bugs? knu?...
int
main()
{
unsigned char i = 127;
char j;
printf(%d\n, ((char)(i 1)));
j = ((char)(i 1)) / 2;
printf(%d\n, j);
Thomas David Rivers wrote:
Well - it's not counter-intuitive on many machines... For example,
on the IBM mainframe - there is an instruction to load a character
into a register - but not one that loads *and* sign-extends. So,
you can get much better code if characters are unsigned by
19 matches
Mail list logo