Target control of Fortran options
N.M. Maclaren
nmm1@cam.ac.uk
Thu Oct 4 15:41:00 GMT 2018
On Oct 4 2018, Paul Koning wrote:
>
> It appears that Fortran has a different approach. Fortran has syntax like
> "REAL*8" to request a float of a specific size. And what gfortran does is
> assume that "REAL" without a size specifier means "REAL*n" for a well
> known fixed n. Without switches, n is 4, which is indeed the common
> answer. But in my case, there isn't any 4-byte float type unless you say
> -mfloat32.
If you don't have a 4-byte REAL, why do you make default REAL 4 bytes?
Do you mean that the front-end code assumes that it is? In which case,
I would say that it's a clear design bug! If not, why not just set it to
your basic floating type?
It's commonly 8 bytes on machines where that is the basic real size (e.g.
Cray vector systems); I don't know if gfortran supports any such systems,
but that's the approach that is universally taken for them. In fact,
mapping REAL*4 to 8 bytes is quite common with precision-extension options
in some compilers, and your implementation sounds similar.
I assume that you know that REAL*n isn't a standard Fortran facility, and
the "n" isn't always the size in bytes. For the standard equivalent,
what does your version map REAL(SELECTED_REAL_SIZE(6)) to?
Regards,
Nick Maclaren.
More information about the Fortran
mailing list