Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
* DEC OSF/1 V2.0 - compiler bug?
@ 1994-05-05 16:56 James Bonfield
  0 siblings, 0 replies; only message in thread
From: James Bonfield @ 1994-05-05 16:56 UTC (permalink / raw)


Hello,

I've got the following snippet of code in one of my programs:

{
    float www = 691.25;

    fputs("Before\n", stderr);
    fprintf(stderr, "%d\n", (int)www);
    fputs("After\n", stderr);
}

This produces the output:

Before
forrtl: error: floating underflow
691
After

The error message is from Fortran trapping SIGFPE. The program contains
Fortran code too and so links with the Fortran libraries.

A standalone C program with the above code works fine. Also even the joing
C-fortran program the signal isn't generated everywhere, just at this
particular point in the code.

I'm using cc; gcc doesn't have these problems.

Now the question is, is there any conceivable memory corruption (ie a bug in
our program) that could cause such an exception? It's most definitely the cast
operator that seems to fail. Yet the correct answer is also produced even when
generating a signal.

Has anyone else observed this behaviour? Are the special flags I should
compile and/or link with that may help resolve such behaviour?

Cheers,

	James
-- 
James Bonfield (jkb@mrc-lmb.cam.ac.uk)   Tel: 0223 402499   Fax: 0223 412282
Medical Research Council - Laboratory of Molecular Biology,
Hills Road, Cambridge, CB2 2QH, England.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1994-05-05 16:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1994-05-05 16:56 DEC OSF/1 V2.0 - compiler bug? James Bonfield

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox