- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
hello,
I'm wrote a program, half a year ago. It worked perfectly. Now a collegue tried to run it, but she got some really bogus results ... so I started debugging.
The problem is like this:
I have an integer and a float array. When I write the integer before and after, my nested do-loops for filling my float array, ... I get different results
It seems that the address of my integer is the same as the address of 1 element of my array. So ... with the filling of my array, my integer gets overwritten and ....
Nowhere in the program is there any usage of pointers, so I couldn't accidently change addresses ...
Now for the weirdest thing ...
when I add an extra write(*,*) of one completly different variable, between the write of the int AND the filling of the array ...
magic happens, and everything works as was intended.
Anyone can help me with this ? This type of problem( getting bogus data, which can be solved by adding some nonsense write(*,*) 's, ), I have encountered now, for the third time ... Do I miss something important/obvious ?
Thanks in advance
Jo
Link kopiert
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
Turn on bounds checking (-CB) and verify that when you pass arguments the types match. Try compiling with "-gen_interfaces -warn interfaces" and see if it tells you anything.
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
Steve,
Thank you for yourquick reply.
The -CB optionindeed pointed out where we went out of bounds. We corrected our bug accordingly.
Thank you very much !!!!!
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden

- RSS-Feed abonnieren
- Thema als neu kennzeichnen
- Thema als gelesen kennzeichnen
- Diesen Thema für aktuellen Benutzer floaten
- Lesezeichen
- Abonnieren
- Drucker-Anzeigeseite