Stuart Pope wrote:
I am puzzled. I am using gpc on a unix system (Irix 6.5). When the compiler was built, we had to turn off the -g flag everywhere in the Makefiles(which, we understand, is a common problem) in order to complete the build. Below is a small program which simply writes out a real number using 'writeln'. It compiles fine, but generates garbage output:
program testprog(input,output); var x : real;
begin x := 10.0; writeln('The value of x is ',x); end.
This code produces the following line of output on my machine(SGI):
The value of x is /// /////////e-//8//8
What's up with this????
That's a known bug on IRIX (listed on the To-Do list, http://agnes.dida.physik.uni-essen.de/~gnu-pascal/todo.html). (Peter, this will be fixed by getting rid of the varargs stuff in the RTS.) For now, there's a work-around (in recent GPC versions). Please look for `LongReal2Str' in the `GPC' unit. The following should work. Sorry for the inconvenience. program testprog(input,output); uses GPC; var x : real; begin x := 10.0; writeln('The value of x is ', LongReal2Str (x, NoWidth, NoPrecision)); end. Frank -- Frank Heckenbach, frank@g-n-u.de, http://fjf.gnu.de/ GPC To-Do list, latest features, fixed bugs: http://agnes.dida.physik.uni-essen.de/~gnu-pascal/todo.html