On 18/09/07 23:19, Hendrik van Hees wrote:
..
In 99.9% of all cases there is no problem with my (rather simple) codes.
I can compile them without trouble. Only when I do some (either very
simple) I/O, an incompatibility occurs. It happens if I write to a file
and then read in the same file again within the same program. This
worked without trouble in the older gcc version, but creates weird
run-time errors in the new version:
invalid number: incomprehensible list input
apparent state: unit 1 named RW-total-tadmix4pi-6pi-om-phi-DY.dat
last format: list io
lately reading sequential formatted external IO
Aborted
Here, "RW-total-tadmix4pi-6pi-om-phi-DY.dat" is the file I write to disk
and then read it in again.
Of course it's not a big deal to rewrite the code that this is
re-reading not necessary. But, if someone knows a compiler switch or
the like so that the writing out and reading in of a file in the same
program works again, it would save me some time.
Such basic functionality shouldn't be broken between minor releases, if
your program is correct (re-reading may depend on the language, you may
need to clear C++ EOF conditions and such).
The error message you give does not indicate what is wrong (your program
complains about not being able to parse something it has supposedly read
from the file - but the read could have failed, or you are reading from
a different position than expected, or you corrupted the data already on
write, etc). Which means you probably have to spend some time figuring
out what exactly is broken with your data file (and hence with your
program). There is a small chance that you have hit some compiler
optimization issue (that e.g. affects memory layout), I'd recommend to
switch off compiler optimization for such tests (-O0).
You could also check the changelog, both from upstream gcc
http://gcc.gnu.org/news.html (each release should have a list of changes
and "bugs fixed"), and the respective patches from SuSE and Red Hat on
top of these releases ("rpm -q --changelog gcc").
Hope this helps
Jan