public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c/9502: shift of long long broken
@ 2003-01-29 20:02 ebotcazou
  0 siblings, 0 replies; 4+ messages in thread
From: ebotcazou @ 2003-01-29 20:02 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, nobody, roger.dahl

Synopsis: shift of long long broken

State-Changed-From-To: open->closed
State-Changed-By: ebotcazou
State-Changed-When: Wed Jan 29 20:02:24 2003
State-Changed-Why:
    Not a bug. You need to write:
    unsigned long long int a = 1ULL << 32;

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9502


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: c/9502: shift of long long broken
@ 2003-01-29 18:46 Andrew Pinski
  0 siblings, 0 replies; 4+ messages in thread
From: Andrew Pinski @ 2003-01-29 18:46 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c/9502; it has been noted by GNATS.

From: Andrew Pinski <apinski@apple.com>
To: roger.dahl@am.sony.com
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: c/9502: shift of long long broken
Date: Wed, 29 Jan 2003 10:37:29 -0800

 The warning is right, 1 is not a long long but just an int.
 Use C99 way of say 1 is a long long by LL.
 
 Thanks,
 Andrew Pinski
 
 
 On Wednesday, Jan 29, 2003, at 10:13 US/Pacific, roger.dahl@am.sony.com 
 wrote:
 
 >
 >> Number:         9502
 >> Category:       c
 >> Synopsis:       shift of long long broken
 >> Confidential:   no
 >> Severity:       serious
 >> Priority:       medium
 >> Responsible:    unassigned
 >> State:          open
 >> Class:          sw-bug
 >> Submitter-Id:   net
 >> Arrival-Date:   Wed Jan 29 18:16:00 UTC 2003
 >> Closed-Date:
 >> Last-Modified:
 >> Originator:     roger.dahl@am.sony.com
 >> Release:        3.2 and 2.96
 >> Organization:
 >> Environment:
 > DJGPP MS-DOS (3.2), GCC Linux (2.96)
 >> Description:
 > Shift in assignment fails when type is long long and shift argument is 
 > > 31
 >> How-To-Repeat:
 > unsigned long long int a = 1 << 32;
 >
 > Note the compiler warning message and the resulting code.
 >> Fix:
 > unsigned long long int a = 1;
 > a <<= 32;
 >> Release-Note:
 >> Audit-Trail:
 >> Unformatted:
 >
 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: c/9502: shift of long long broken
@ 2003-01-29 18:36 Graham Stott
  0 siblings, 0 replies; 4+ messages in thread
From: Graham Stott @ 2003-01-29 18:36 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c/9502; it has been noted by GNATS.

From: Graham Stott <graham.stott@btinternet.com>
To: roger.dahl@am.sony.com
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: c/9502: shift of long long broken
Date: Wed, 29 Jan 2003 18:27:30 +0000

 Not a bug your example is broken.
 
 You are shifting "1" which is an int.
 
 The fact that "a" is long long make no difference here.
 
 You need to use 1LL to specify that is a long long "1".
 
 Graham
 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* c/9502: shift of long long broken
@ 2003-01-29 18:16 roger.dahl
  0 siblings, 0 replies; 4+ messages in thread
From: roger.dahl @ 2003-01-29 18:16 UTC (permalink / raw)
  To: gcc-gnats


>Number:         9502
>Category:       c
>Synopsis:       shift of long long broken
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jan 29 18:16:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     roger.dahl@am.sony.com
>Release:        3.2 and 2.96
>Organization:
>Environment:
DJGPP MS-DOS (3.2), GCC Linux (2.96)
>Description:
Shift in assignment fails when type is long long and shift argument is > 31
>How-To-Repeat:
unsigned long long int a = 1 << 32;

Note the compiler warning message and the resulting code.
>Fix:
unsigned long long int a = 1;
a <<= 32;
>Release-Note:
>Audit-Trail:
>Unformatted:


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-01-29 20:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-29 20:02 c/9502: shift of long long broken ebotcazou
  -- strict thread matches above, loose matches on Subject: below --
2003-01-29 18:46 Andrew Pinski
2003-01-29 18:36 Graham Stott
2003-01-29 18:16 roger.dahl

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).