Subject: Re: Floating Point and 486's
To: David B. Wollner <>
From: Danny Thomas <>
List: current-users
Date: 04/29/1994 09:10:56
>I am trying to port a postscript interpreter to NetBSD-current (iastate
>binaries as of a couple of days ago).  I'm hitting an interesting bug where
>a float parameter I sent to the subroutine changes it's value dramatically
>within the subroutine.  A copy of my test program is appended below.  If
>anyone has any information, I would appreciate it!
>        - dbw
>void checkparam();

this is going to sound slightly flamish, but my first thought was "no
prototype" and it surprises me that people don't use prototypes all the
time - they only taske a tiny amount of time to write compared with the
benefits they provide of error detection and/or generation of correct code.
They are sometimes essential with ANSI compilers, eg for functions that
take variable number of arguments. The near-universal availability of gcc
means that people can't say "I'd use them but the vendors (free) compiler
doesn't support them...". Another thing to try when you're coming up
against puzzling behavious is to "gcc -Wall" or the "-pedantic" option and
at least understand what the warnings are about and whether they might
provide an indication to the problem source. While the program runs and
produces no output for me on a 486DX2 @66MHz, you might want to change to
the following lines:

#include  <stdio.h>
void checkparam(char *cp, float f1, float f2, float *pf1, float *pf2);

NB no output is produced before I made either of the above changes.

You did mention using nearly -current, but what compiler (version) and
options were you using? This sort of info along with your system specs (eg
CPU model/maker/speed)  would improve responses to your posting, as was
mycroft's wondering as to the expected output.

Danny Thomas

PS and what PostScript interpreter were you running into problems with? I
recently got Ghostscript 2.61 up and running fine on my NetBSD 0.9 system
without any drama. At least there were no problems so far with the few
files I run, including 5M eps files => 36M colour raster. Actually I was
surprised that rendering such a large file onto such a large pixelmap only
took a few minutes. Now to download them to the slide recorder...