Sirs, 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???? Thanks for any help you can give. Stuart Pope ***************************************************************************** Stuart Pope Mail Stop 931 COMPUTER SCIENCES CORP. (757) 864-5775 (Voice) GEOLAB/ISSD (757) 864-8910 (FAX) Hampton, VA Email: d.s.pope@larc Check out our webpage at http://geolab.larc.nasa.gov/ (No animals were harmed or killed in the generation of this mail message) *****************************************************************************
Hello, Stuart Pope, you wrote:
writeln('The value of x is ',x); [...] The value of x is /// /////////e-//8//8
Which version of GPC are you running? This information is important for us if we want to give useful help. (If you are not sure, please type `gpc -v'.) Peter -- http://home.pages.de/~Peter.Gerwinski/ - G-N-U GmbH: http://www.g-n-u.de Maintainer GNU Pascal - http://home.pages.de/~GNU-Pascal/ - gpc-20001006 GnuPG key fingerprint: 9E7C 0FC4 8A62 5536 1730 A932 9834 65DB 2143 9422 keys: http://www.gerwinski.de/pubkeys/ - AntiSpam: http://spam.abuse.net
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
participants (3)
-
Frank Heckenbach -
Peter Gerwinski -
Stuart Pope