public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/6568: g++3 (3.0.2) misinterpreting single byte hex constants
@ 2002-05-05 20:16 brian
0 siblings, 0 replies; 6+ messages in thread
From: brian @ 2002-05-05 20:16 UTC (permalink / raw)
To: gcc-gnats
>Number: 6568
>Category: c++
>Synopsis: g++3 (3.0.2) misinterpreting single byte hex constants
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sun May 05 20:16:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: Brian Ceccarelli
>Release: g++3 3.0.2 (Red Hat LInux 7.2)
>Organization:
>Environment:
Red Hat Linux 7.2
Intel x686
>Description:
g++3 compiler is really screwing up the value of this hex constant. It is turning the single byte 'char' into a 4-byte integer, and then screwing up the conditional.
>How-To-Repeat:
Easy. Just run this 5 line program.
>Fix:
I don't know how to fix this one. Some one familiar with the compiler code is going to have to fix this.
>Release-Note:
>Audit-Trail:
>Unformatted:
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: c++/6568: g++3 (3.0.2) misinterpreting single byte hex constants
@ 2002-05-06 1:26 neil
0 siblings, 0 replies; 6+ messages in thread
From: neil @ 2002-05-06 1:26 UTC (permalink / raw)
To: brian, gcc-bugs, gcc-prs, nobody
Synopsis: g++3 (3.0.2) misinterpreting single byte hex constants
State-Changed-From-To: open->feedback
State-Changed-By: neil
State-Changed-When: Mon May 6 01:26:16 2002
State-Changed-Why:
Missing testcase. Please reply to this e-mail with the
5-line test case in the body of your e-mail; without changing the subject line or the cc: list. That will ensure it goes into our bug system.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6568
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: c++/6568: g++3 (3.0.2) misinterpreting single byte hex constants
@ 2002-05-06 5:26 Brian Ceccarelli
0 siblings, 0 replies; 6+ messages in thread
From: Brian Ceccarelli @ 2002-05-06 5:26 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR c++/6568; it has been noted by GNATS.
From: "Brian Ceccarelli" <brian@talusmusic.com>
To: <neil@gcc.gnu.org>,
<brian@talusmusic.com>,
<gcc-bugs@gcc.gnu.org>,
<gcc-prs@gcc.gnu.org>,
<nobody@gcc.gnu.org>,
<gcc-gnats@gcc.gnu.org>
Cc:
Subject: RE: c++/6568: g++3 (3.0.2) misinterpreting single byte hex constants
Date: Mon, 6 May 2002 08:20:25 -0400
localhost:[17] /home/ceccareb/work % uname -a
Linux localhost.localdomain 2.4.7-10 #1 Thu Sep 6 17:27:27 EDT 2001 i686
unknown
localhost:[18] /home/ceccareb/work % g++3 -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.0.2/specs
Configured with:
../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info
--enable-shared --enable-threads=posix --disable-checking --host=i386-redha
t-linux
Thread model: posix
gcc version 3.0.2 20010905 (Red Hat Linux 7.1 3.0.1-3)
localhost:[42] /usr/src %
localhost:[19] /home/ceccareb/work % cat test.cc
# include <stdio.h>
int main(int argc, char *argv[])
{
int i;
char n;
i = 0;
n = (-1);
printf("sizeof(i) = %d\n", sizeof i);
printf("sizeof(n) = %d\n", sizeof n);
if (n == 0xFF)
printf("Yes. n = 0x%x\n", n);
else
printf("No. n = 0x%x\n", n);
return 0;
}
localhost:[20] /home/ceccareb/work % g++3 test.cc
test.cc: In function `int main(int, char**)':
test.cc:17: warning: comparison is always false due to limited range of data
type
localhost:[21] /home/ceccareb/work % a.out
sizeof(i) = 4
sizeof(n) = 1
No. n = 0xffffffff
localhost:[22] /home/ceccareb/work %
-----Original Message-----
From: neil@gcc.gnu.org [mailto:neil@gcc.gnu.org]
Sent: Monday, May 06, 2002 4:26 AM
To: brian@talusmusic.com; gcc-bugs@gcc.gnu.org; gcc-prs@gcc.gnu.org;
nobody@gcc.gnu.org
Subject: Re: c++/6568: g++3 (3.0.2) misinterpreting single byte hex
constants
Synopsis: g++3 (3.0.2) misinterpreting single byte hex constants
State-Changed-From-To: open->feedback
State-Changed-By: neil
State-Changed-When: Mon May 6 01:26:16 2002
State-Changed-Why:
Missing testcase. Please reply to this e-mail with the
5-line test case in the body of your e-mail; without changing the
subject line or the cc: list. That will ensure it goes into our bug system.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&p
r=6568
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: c++/6568: g++3 (3.0.2) misinterpreting single byte hex constants
@ 2002-05-06 6:26 Brian Ceccarelli
0 siblings, 0 replies; 6+ messages in thread
From: Brian Ceccarelli @ 2002-05-06 6:26 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR c++/6568; it has been noted by GNATS.
From: "Brian Ceccarelli" <brian@talusmusic.com>
To: <neil@gcc.gnu.org>,
<brian@talusmusic.com>,
<gcc-bugs@gcc.gnu.org>,
<gcc-prs@gcc.gnu.org>,
<nobody@gcc.gnu.org>,
<gcc-gnats@gcc.gnu.org>
Cc:
Subject: RE: c++/6568: g++3 (3.0.2) misinterpreting single byte hex constants
Date: Mon, 6 May 2002 09:20:59 -0400
Subject: Re: c++/6568: g++3 (3.0.2) misinterpreting single byte hex
************************************
localhost:[17] /home/ceccareb/work % uname -a
Linux localhost.localdomain 2.4.7-10 #1 Thu Sep 6 17:27:27 EDT 2001 i686
unknown
localhost:[18] /home/ceccareb/work % g++3 -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.0.2/specs
Configured with:
../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info
--enable-shared --enable-threads=posix --disable-checking --host=i386-redha
t-linux
Thread model: posix
gcc version 3.0.2 20010905 (Red Hat Linux 7.1 3.0.1-3)
localhost:[42] /usr/src %
localhost:[19] /home/ceccareb/work % cat test.cc
# include <stdio.h>
int main(int argc, char *argv[])
{
int i;
char n;
i = 0;
n = (-1);
printf("sizeof(i) = %d\n", sizeof i);
printf("sizeof(n) = %d\n", sizeof n);
if (n == 0xFF)
printf("Yes. n = 0x%x\n", n);
else
printf("No. n = 0x%x\n", n);
return 0;
}
localhost:[20] /home/ceccareb/work % g++3 test.cc
test.cc: In function `int main(int, char**)':
test.cc:17: warning: comparison is always false due to limited range of data
type
localhost:[21] /home/ceccareb/work % a.out
sizeof(i) = 4
sizeof(n) = 1
No. n = 0xffffffff
localhost:[22] /home/ceccareb/work %
**************************************
-----Original Message-----
From: neil@gcc.gnu.org [mailto:neil@gcc.gnu.org]
Sent: Monday, May 06, 2002 4:26 AM
To: brian@talusmusic.com; gcc-bugs@gcc.gnu.org; gcc-prs@gcc.gnu.org;
nobody@gcc.gnu.org
Subject: Re: c++/6568: g++3 (3.0.2) misinterpreting single byte hex
constants
Synopsis: g++3 (3.0.2) misinterpreting single byte hex constants
State-Changed-From-To: open->feedback
State-Changed-By: neil
State-Changed-When: Mon May 6 01:26:16 2002
State-Changed-Why:
Missing testcase. Please reply to this e-mail with the
5-line test case in the body of your e-mail; without changing the
subject line or the cc: list. That will ensure it goes into our bug system.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&p
r=6568
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: c++/6568: g++3 (3.0.2) misinterpreting single byte hex constants
@ 2002-05-06 8:26 Neil Booth
0 siblings, 0 replies; 6+ messages in thread
From: Neil Booth @ 2002-05-06 8:26 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR c++/6568; it has been noted by GNATS.
From: Neil Booth <neil@daikokuya.demon.co.uk>
To: Brian Ceccarelli <brian@talusmusic.com>
Cc: neil@gcc.gnu.org, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org,
nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org
Subject: Re: c++/6568: g++3 (3.0.2) misinterpreting single byte hex constants
Date: Mon, 6 May 2002 16:22:36 +0100
Brian Ceccarelli wrote:-
> i = 0;
> n = (-1);
>
> printf("sizeof(i) = %d\n", sizeof i);
> printf("sizeof(n) = %d\n", sizeof n);
>
> if (n == 0xFF)
> printf("Yes. n = 0x%x\n", n);
> else
> printf("No. n = 0x%x\n", n);
Please explain why your test should give "Yes". I think
"No" is correct.
Neil.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: c++/6568: g++3 (3.0.2) misinterpreting single byte hex constants
@ 2002-05-06 13:50 neil
0 siblings, 0 replies; 6+ messages in thread
From: neil @ 2002-05-06 13:50 UTC (permalink / raw)
To: brian, gcc-bugs, gcc-prs, nobody
Synopsis: g++3 (3.0.2) misinterpreting single byte hex constants
State-Changed-From-To: feedback->closed
State-Changed-By: neil
State-Changed-When: Mon May 6 13:50:14 2002
State-Changed-Why:
Not a bug.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6568
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2002-05-06 20:50 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-05-05 20:16 c++/6568: g++3 (3.0.2) misinterpreting single byte hex constants brian
2002-05-06 1:26 neil
2002-05-06 5:26 Brian Ceccarelli
2002-05-06 6:26 Brian Ceccarelli
2002-05-06 8:26 Neil Booth
2002-05-06 13:50 neil
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).