🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #6220

Bug with global defined Data-classes

#6220
From: Martin Sperl
Date: Mon, 15 Jan 1996 00:00
51 lines
2123 bytes
Hi !!!

I am using gcc 2.7.2 on a linux Box and came across a strange bug:
in my main-routine I have declared a essential datastructure
globally and the programm gives correct results, but if I make this 
variable a local one, then the calculations give strange results.

Then I tried with dynamic allocation and it gives the correct results

The compiler-options that I am using are:
-m486 -pg -Wall -O2

Using in addition the compiler-option -V2.7.0 gives the same results.

The main-programm looks like this:

#include "../text/txprojec.h"

int main()
{
  txPeriProject tmp;

  tmp.LoadTimeString("/home/sperl/peri/samples/dpb.dat");
  
  tmp.SetFrequency(0,"2.1");
  tmp.SetFrequency(1,"4.4");
  tmp.SetFrequency(2,"6.5");
  tmp.SetFrequency(3,"7.7");
  tmp.SetFrequency(4,"8.93");
  tmp.SetFrequency(5,"12.1");
  
  tmp.CalculatePeriod();
}

Actually I can live with this bug, as I can work around it, but still
I had some problem solving this bug at first...

Ciao, Martin

-------------------------------------------------------------------------------
Martin Sperl
-------------------------------------------------------------------------------
Home:   Nattergasse 12/32     Office: Institut fuer Astronomie
        A-1170 Vienna                 Tuerkenschanzstrasse 17
        Austria                       A-1180 Vienna
                                      Austria
Phone:  ~~43-1-489 52 94              ~~43-1-470 68 00-184
Fax:    none                          ~~43-1-470 68 00-15

E-Mail: sperl@procyon.ast.univie.ac.at
-------------------------------------------------------------------------------
Technical Details
Message-ID: <Pine.LNX.3.91.960115140902.6155A-100000@procyon.ast.univie.ac.at>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 113d02,5ad855764eb8173c,start
X-Google-Attributes: gid113d02,public
From: sperl@procyon.ast.univie.ac.at (Martin Sperl)
Subject: Bug with global defined Data-classes
Date: 1996/01/15
Message-ID: <Pine.LNX.3.91.960115140902.6155A-100000@procyon.ast.univie.ac.at>
X-Deja-AN: 135279389
distribution: gnu
sender: daemon@cis.ohio-state.edu
organization: GNUs Not Usenet
newsgroups: gnu.gcc.bug