You should check whether the capability is even supported. Modified test:
program main
use ieee_exceptions
if (ieee_support_halting (ieee_invalid)) then
print *, "Halting for invalid supported"
call ieee_set_halting_mode (ieee_invalid, .true.)
call ieee_set_flag (ieee_invalid, .true.)
print *, 'hello'
else
print *, "Halting for invalid not supported"
end if
end program
Even with this test, I'd believe you see unexpected output.
Cheers,
Bill
On 2/28/12 8:46 PM, Neil Carlson wrote:
> Assuming your compiler is modern enough to compile the following
> program, what should be its run-time behavior?
>
> program main
> use ieee_exceptions
> call ieee_set_halting_mode (ieee_invalid, .true.)
> call ieee_set_flag (ieee_invalid, .true.)
> print *, 'hello'
> end program
>
> With one compiler the program throws a run-time error (before the print)
> as I expected, but with another the program terminates normally with only
> a warning about an invalid operation having occurred -- the same type of
> warning that non-signalling errors produce.
>
> ieee_set_flag (ieee_invalid, .true.) sets the ieee_invalid flag to
> signalling,
> but the standard seems to be silent about what the system is actually
> supposed to do with that. So is it possible that both compilers are
> standard conforming?
>
> -Neil
>
>
--
Bill Long [log in to unmask]
Fortran Technical Support & voice: 651-605-9024
Bioinformatics Software Development fax: 651-605-9142
Cray Inc./Cray Plaza, Suite 210/380 Jackson St./St. Paul, MN 55101
|