possible Sun-4 bug?

Alan Parker parker at epiwrl.EPI.COM
Thu Apr 28 10:55:18 AEST 1988


We had a section of code fail on a Sun-4 that was like this:

double foo();

if ((int)foo(a)) { stuff }

stuff was being executed even when foo returned exactly zero.

I changed it to:

double foo();
int i;

i = foo(a);
if (i) { stuff }

and the code did what I intended it to do.

Should this have worked properly, or am I doing something wrong here?
Is this a known Sun-4 problem?   We had this problem on a machine as a
customer demo site, so I don't have any details about the revisions of
the hardware or the Sun software, but I could probably find out.



More information about the Comp.unix.questions mailing list