🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Martin Sperl Mon, 15 Jan 1996 00:00
Bug with global defined Data-classes
#6220
Author: 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
-------------------------------------------------------------------------------
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads