Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: jkb@mrc-lmb.cam.ac.uk (James Bonfield)
Subject: DEC OSF/1 V2.0 - compiler bug?
Date: 5 May 1994 16:56:59 GMT	[thread overview]
Message-ID: <2qb8gr$afh@lyra.csx.cam.ac.uk> (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.


                 reply	other threads:[~1994-05-05 16:56 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
read-only archive

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