🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #6122

Re: long long bug?

#6122
From: Pavel Pokorny
Date: Thu, 05 Dec 1996 00:00
32 lines
1987 bytes
Staale L. Hansen (staale@spacetec.no) wrote:
: In a loop reading data from disk I have a global counter of type
: "long long", which is incremented by the number of bytes read.
: The counter increases normally for a while, but suddenly it jumps
: to a gigantic number (~120E12).
: If I change the variable type to "long", or make it volatile, this
: does not happen.

: The code is too long to post here, but it is compiled with gcc 2.7.2.1
: on Solaris x86 (Pentium) 2.5, with no optimization

: Has anyone else seen this? Are there any known bugs with "long long"'s?

: -- 
: Staale L. Hansen, M.Sc.       | Spacetec A.S, Prestvannv. 38,
: Software Engineer             | N-9005 Tromsoe, Norway
: EMail: staale@spacetec.no     | Phone: +47 77 66 08 00
: WWW:   http://www.spacetec.no | Fax:   +47 77 65 58 59

One explanation could be:
some other part of you program writes incorrestly to a certain 
portion of memory. If you counter is of type long double,
it occupies this portion of memory and is thus changed,
while if your counter is of type long it does not occupy
this memory and thus is not changed. :-)

 Pavel POKORNY                                   phone: +42 2 24 35 50 33    
 Department of Mathematics                              +42 2 24 35 30 96    
 Prague Institute of Chemical Technology         fax:   +42 2 34 27 63
 Technicka 5
 166 28 Prague, Czech Republic             e-mail: Pavel.Pokorny@vscht.cz 
Technical Details
Message-ID: <5867mr$sul@news.eunet.cz>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <32A488AA.75B6@spacetec.no>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 113d02,731dc3ea5e89329b
X-Google-Attributes: gid113d02,public
From: pokornp@math.vscht.cz (Pavel Pokorny)
Subject: Re: long long bug?
Date: 1996/12/05
Message-ID: <5867mr$sul@news.eunet.cz>
X-Deja-AN: 202475549
sender: bug-gcc-request@prep.ai.mit.edu
references: <32A488AA.75B6@spacetec.no>
organization: Institute of Chemical Technology, Prague
x-gateway: relay7.UU.NET from bug-gcc to gnu.gcc.bug; Thu, 5 Dec 1996 05:15:15 EST
newsgroups: gnu.gcc.bug