public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c/9569: 8 bytes seems to long for long long int
@ 2003-02-04 13:36 stefaandr
0 siblings, 0 replies; 11+ messages in thread
From: stefaandr @ 2003-02-04 13:36 UTC (permalink / raw)
To: gcc-gnats
>Number: 9569
>Category: c
>Synopsis: 8 bytes seems to long for long long int
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: rejects-legal
>Submitter-Id: net
>Arrival-Date: Tue Feb 04 13:36:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator: stefaandr@hotmail.com
>Release: gcc version 3.4 20030204 (experimental)
>Organization:
>Environment:
redhat 8.0
Reading specs from /esat/quendi/stefaan/install/lib/gcc-lib/i686-pc-linux-gnu/3.4/specs
Configured with: ../../src/gcc/configure --enable-languages=c,c++ --prefix=/esat/quendi/stefaan/install
Thread model: posix
gcc version 3.4 20030204 (experimental)
>Description:
compile this code:
int main() {
long long int x = 0x0123456789abcdef;
};
it gives:
test6.cpp: In function `int main()':
test6.cpp:2: error: integer constant is too large for "long" type
>How-To-Repeat:
compile code contained in description
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: c/9569: 8 bytes seems to long for long long int
@ 2003-02-06 7:36 Segher Boessenkool
0 siblings, 0 replies; 11+ messages in thread
From: Segher Boessenkool @ 2003-02-06 7:36 UTC (permalink / raw)
To: aj; +Cc: gcc-prs
The following reply was made to PR c/9569; it has been noted by GNATS.
From: Segher Boessenkool <segher@koffie.nl>
To: Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
Cc: "Joseph S. Myers" <jsm28@cam.ac.uk>,
Neil Booth <neil@daikokuya.co.uk>, aj@gcc.gnu.org,
gcc-bugs@gcc.gnu.org, stefaandr@hotmail.com, gcc-gnats@gcc.gnu.org
Subject: Re: c/9569: 8 bytes seems to long for long long int
Date: Thu, 06 Feb 2003 07:12:02 +0100
Falk Hueffner wrote:
> I still don't get it. In C99, this is perfectly legal code, and does
> what the reporter wants. It is of course documented nowhere, but I
> would assume that g++ inherits C99's long long semantics if long long
> is enabled. Why not this part?
Apart from the C vs. C++ issue, GCC is not a C99 compiler
by default, you have to pass -std=c99 or similar.
I wouldn't mind if this changed...
Segher
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: c/9569: 8 bytes seems to long for long long int
@ 2003-02-06 7:06 Neil Booth
0 siblings, 0 replies; 11+ messages in thread
From: Neil Booth @ 2003-02-06 7:06 UTC (permalink / raw)
To: aj; +Cc: gcc-prs
The following reply was made to PR c/9569; it has been noted by GNATS.
From: Neil Booth <neil@daikokuya.co.uk>
To: "Joseph S. Myers" <jsm28@cam.ac.uk>
Cc: Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>, aj@gcc.gnu.org,
gcc-bugs@gcc.gnu.org, stefaandr@hotmail.com, gcc-gnats@gcc.gnu.org
Subject: Re: c/9569: 8 bytes seems to long for long long int
Date: Thu, 6 Feb 2003 06:59:24 +0000
Joseph S. Myers wrote:-
> On 6 Feb 2003, Falk Hueffner wrote:
>
> > I still don't get it. In C99, this is perfectly legal code, and does
> > what the reporter wants. It is of course documented nowhere, but I
> > would assume that g++ inherits C99's long long semantics if long long
> > is enabled. Why not this part?
>
> C++98 is stricter than C90 about integer constants. _Explicitly_ using
> long long is one thing (accepted as an extension by the C++ compiler),
> _implicitly_ using it (by having too large an integer constant without a
> suffix) is another. The behaviour may or may not be as intended; that's
> for the C++ maintainers to work out.
I suggest the PR be re-opened then.
Neil.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: c/9569: 8 bytes seems to long for long long int
@ 2003-02-06 0:16 Joseph S. Myers
0 siblings, 0 replies; 11+ messages in thread
From: Joseph S. Myers @ 2003-02-06 0:16 UTC (permalink / raw)
To: aj; +Cc: gcc-prs
The following reply was made to PR c/9569; it has been noted by GNATS.
From: "Joseph S. Myers" <jsm28@cam.ac.uk>
To: Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
Cc: Neil Booth <neil@daikokuya.co.uk>, <aj@gcc.gnu.org>,
<gcc-bugs@gcc.gnu.org>, <stefaandr@hotmail.com>,
<gcc-gnats@gcc.gnu.org>
Subject: Re: c/9569: 8 bytes seems to long for long long int
Date: Thu, 6 Feb 2003 00:06:25 +0000 (GMT)
On 6 Feb 2003, Falk Hueffner wrote:
> I still don't get it. In C99, this is perfectly legal code, and does
> what the reporter wants. It is of course documented nowhere, but I
> would assume that g++ inherits C99's long long semantics if long long
> is enabled. Why not this part?
C++98 is stricter than C90 about integer constants. _Explicitly_ using
long long is one thing (accepted as an extension by the C++ compiler),
_implicitly_ using it (by having too large an integer constant without a
suffix) is another. The behaviour may or may not be as intended; that's
for the C++ maintainers to work out.
--
Joseph S. Myers
jsm28@cam.ac.uk
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: c/9569: 8 bytes seems to long for long long int
@ 2003-02-06 0:06 Falk Hueffner
0 siblings, 0 replies; 11+ messages in thread
From: Falk Hueffner @ 2003-02-06 0:06 UTC (permalink / raw)
To: aj; +Cc: gcc-prs
The following reply was made to PR c/9569; it has been noted by GNATS.
From: Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
To: "Joseph S. Myers" <jsm28@cam.ac.uk>
Cc: Neil Booth <neil@daikokuya.co.uk>, <aj@gcc.gnu.org>,
<gcc-bugs@gcc.gnu.org>, <stefaandr@hotmail.com>,
<gcc-gnats@gcc.gnu.org>
Subject: Re: c/9569: 8 bytes seems to long for long long int
Date: 06 Feb 2003 00:59:37 +0100
"Joseph S. Myers" <jsm28@cam.ac.uk> writes:
> On Wed, 5 Feb 2003, Neil Booth wrote:
>
> > Could you justify that, or re-open the bug report?
>
> Note that the bug report is actually a C++ bug report in the wrong
> category, and C++ doesn't have long long, and in the C++ compiler
> pedwarns (those that are enabled by default) are errors by default.
I still don't get it. In C99, this is perfectly legal code, and does
what the reporter wants. It is of course documented nowhere, but I
would assume that g++ inherits C99's long long semantics if long long
is enabled. Why not this part?
--
Falk
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: c/9569: 8 bytes seems to long for long long int
@ 2003-02-05 23:46 Neil Booth
0 siblings, 0 replies; 11+ messages in thread
From: Neil Booth @ 2003-02-05 23:46 UTC (permalink / raw)
To: aj; +Cc: gcc-prs
The following reply was made to PR c/9569; it has been noted by GNATS.
From: Neil Booth <neil@daikokuya.co.uk>
To: "Joseph S. Myers" <jsm28@cam.ac.uk>
Cc: aj@gcc.gnu.org, gcc-bugs@gcc.gnu.org, stefaandr@hotmail.com,
gcc-gnats@gcc.gnu.org
Subject: Re: c/9569: 8 bytes seems to long for long long int
Date: Wed, 5 Feb 2003 23:39:02 +0000
Joseph S. Myers wrote:-
> On Wed, 5 Feb 2003, Neil Booth wrote:
>
> > Could you justify that, or re-open the bug report?
>
> Note that the bug report is actually a C++ bug report in the wrong
> category, and C++ doesn't have long long, and in the C++ compiler pedwarns
> (those that are enabled by default) are errors by default.
Great, thanks for the explanation.
Neil.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: c/9569: 8 bytes seems to long for long long int
@ 2003-02-05 22:56 Joseph S. Myers
0 siblings, 0 replies; 11+ messages in thread
From: Joseph S. Myers @ 2003-02-05 22:56 UTC (permalink / raw)
To: aj; +Cc: gcc-prs
The following reply was made to PR c/9569; it has been noted by GNATS.
From: "Joseph S. Myers" <jsm28@cam.ac.uk>
To: Neil Booth <neil@daikokuya.co.uk>
Cc: <aj@gcc.gnu.org>, <gcc-bugs@gcc.gnu.org>, <stefaandr@hotmail.com>,
<gcc-gnats@gcc.gnu.org>
Subject: Re: c/9569: 8 bytes seems to long for long long int
Date: Wed, 5 Feb 2003 22:48:03 +0000 (GMT)
On Wed, 5 Feb 2003, Neil Booth wrote:
> Could you justify that, or re-open the bug report?
Note that the bug report is actually a C++ bug report in the wrong
category, and C++ doesn't have long long, and in the C++ compiler pedwarns
(those that are enabled by default) are errors by default.
--
Joseph S. Myers
jsm28@cam.ac.uk
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: c/9569: 8 bytes seems to long for long long int
@ 2003-02-05 21:06 Neil Booth
0 siblings, 0 replies; 11+ messages in thread
From: Neil Booth @ 2003-02-05 21:06 UTC (permalink / raw)
To: aj; +Cc: gcc-prs
The following reply was made to PR c/9569; it has been noted by GNATS.
From: Neil Booth <neil@daikokuya.co.uk>
To: aj@gcc.gnu.org, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org,
nobody@gcc.gnu.org, stefaandr@hotmail.com, gcc-gnats@gcc.gnu.org
Cc:
Subject: Re: c/9569: 8 bytes seems to long for long long int
Date: Wed, 5 Feb 2003 20:56:45 +0000
aj@gcc.gnu.org wrote:-
> State-Changed-From-To: open->closed
> State-Changed-By: aj
> State-Changed-When: Tue Feb 4 14:37:46 2003
> State-Changed-Why:
> The program is broken, add LL to the constant to get
> a long long constant.
Could you justify that, or re-open the bug report?
Neil.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: c/9569: 8 bytes seems to long for long long int
@ 2003-02-04 18:36 Falk Hueffner
0 siblings, 0 replies; 11+ messages in thread
From: Falk Hueffner @ 2003-02-04 18:36 UTC (permalink / raw)
To: aj; +Cc: gcc-prs
The following reply was made to PR c/9569; it has been noted by GNATS.
From: Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
To: aj@gcc.gnu.org
Cc: gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, nobody@gcc.gnu.org,
stefaandr@hotmail.com, gcc-gnats@gcc.gnu.org
Subject: Re: c/9569: 8 bytes seems to long for long long int
Date: 04 Feb 2003 17:09:21 +0100
aj@gcc.gnu.org writes:
> Synopsis: 8 bytes seems to long for long long int
>
> Responsible-Changed-From-To: unassigned->aj
> Responsible-Changed-By: aj
> Responsible-Changed-When: Tue Feb 4 14:37:46 2003
> Responsible-Changed-Why:
> Taking it.
> State-Changed-From-To: open->closed
> State-Changed-By: aj
> State-Changed-When: Tue Feb 4 14:37:46 2003
> State-Changed-Why:
> The program is broken, add LL to the constant to get
> a long long constant.
Huh? The C standard says: "The type of an integer constant is the
first of the corresponding list in which its value can be
represented." That would make the constant long long without any
suffixes.
The C++ standard doesn't have long long at all, but I would think the
same semantics should be applied here, anything else would be silly.
--
Falk
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: c/9569: 8 bytes seems to long for long long int
@ 2003-02-04 14:37 aj
0 siblings, 0 replies; 11+ messages in thread
From: aj @ 2003-02-04 14:37 UTC (permalink / raw)
To: aj, gcc-bugs, gcc-prs, nobody, stefaandr
Synopsis: 8 bytes seems to long for long long int
Responsible-Changed-From-To: unassigned->aj
Responsible-Changed-By: aj
Responsible-Changed-When: Tue Feb 4 14:37:46 2003
Responsible-Changed-Why:
Taking it.
State-Changed-From-To: open->closed
State-Changed-By: aj
State-Changed-When: Tue Feb 4 14:37:46 2003
State-Changed-Why:
The program is broken, add LL to the constant to get
a long long constant.
Andreas
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9569
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: c/9569: 8 bytes seems to long for long long int
@ 2003-02-04 14:36 Andreas Jaeger
0 siblings, 0 replies; 11+ messages in thread
From: Andreas Jaeger @ 2003-02-04 14:36 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR c/9569; it has been noted by GNATS.
From: Andreas Jaeger <aj@suse.de>
To: stefaandr@hotmail.com
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: c/9569: 8 bytes seems to long for long long int
Date: Tue, 04 Feb 2003 15:35:34 +0100
stefaandr@hotmail.com writes:
>>Number: 9569
>>Category: c
>>Synopsis: 8 bytes seems to long for long long int
> [...]
> int main() {
> long long int x = 0x0123456789abcdef;
0x0123456789abcdef is a const of type int, if you want, a long long
constant, append LL,
Andreas
Andreas
--
Andreas Jaeger
SuSE Labs aj@suse.de
private aj@arthur.inka.de
http://www.suse.de/~aj
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2003-02-06 7:36 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-04 13:36 c/9569: 8 bytes seems to long for long long int stefaandr
2003-02-04 14:36 Andreas Jaeger
2003-02-04 14:37 aj
2003-02-04 18:36 Falk Hueffner
2003-02-05 21:06 Neil Booth
2003-02-05 22:56 Joseph S. Myers
2003-02-05 23:46 Neil Booth
2003-02-06 0:06 Falk Hueffner
2003-02-06 0:16 Joseph S. Myers
2003-02-06 7:06 Neil Booth
2003-02-06 7:36 Segher Boessenkool
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).