This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [PATCH, gfortran testsuite]: Do not load denormals in gfortran.fortran_torture/intrinsic_nearest.f90
On Aug 23 2009, Tim Prince wrote:
I ran into a peculiarity with gfortran C interoperability. It throws a
fatal KIND mismatch, as KIND(.false.) is 4, and KIND(c_bool) is 1. I
assumed that IEEE_SET_UNDERFLOW_MODE(gradual) should work with
logical(c_bool) :: gradual
Have I gone wrong in my assumption, or does the standard require
CALL IEEE_SET_UNDERFLOW_MODE(LOGICAL(.false.,KIND(C_BOOL)))
if IEEE_SET_UNDERFLOW is written according to iso_c_interop ?
Oh, gosh, you really do need a copy of the standard to work from. IEEE
support has nothing to do with C interoperability. IEEE_SET_UNDERFLOW_MODE
etc. are intrinsics, and follow whatever rules Fortran specifies - NOT
necessarily ones that any normal procedure can follow - in this case, its
argument is specified to be a default LOGICAL scalar, so you should be using
just .FALSE.
So a fatal KIND mismatch is correct for C_BOOL. Incidentally, as a general
rule, avoid C99 bool like the plague - it's a lot safer to stick to int,
in the traditional way.
Regards,
Nick Maclaren.
- References:
- [PATCH, gfortran testsuite]: Do not generate denormals in gfortran.dg/boz_9.f90
- Re: [PATCH, gfortran testsuite]: Do not generate denormals in gfortran.dg/boz_9.f90
- [PATCH, gfortran testsuite]: Do not load denormals in gfortran.fortran_torture/intrinsic_nearest.f90
- Re: [PATCH, gfortran testsuite]: Do not load denormals in gfortran.fortran_torture/intrinsic_nearest.f90
- Re: [PATCH, gfortran testsuite]: Do not load denormals in gfortran.fortran_torture/intrinsic_nearest.f90
- Re: [PATCH, gfortran testsuite]: Do not load denormals in gfortran.fortran_torture/intrinsic_nearest.f90
- Re: [PATCH, gfortran testsuite]: Do not load denormals in gfortran.fortran_torture/intrinsic_nearest.f90
- Re: [PATCH, gfortran testsuite]: Do not load denormals in gfortran.fortran_torture/intrinsic_nearest.f90
- Re: [PATCH, gfortran testsuite]: Do not load denormals in gfortran.fortran_torture/intrinsic_nearest.f90
- Re: [PATCH, gfortran testsuite]: Do not load denormals in gfortran.fortran_torture/intrinsic_nearest.f90
- Re: [PATCH, gfortran testsuite]: Do not load denormals in gfortran.fortran_torture/intrinsic_nearest.f90