Target control of Fortran options
N.M. Maclaren
nmm1@cam.ac.uk
Thu Oct 4 16:20:00 GMT 2018
On Oct 4 2018, Paul Koning wrote:
>>
>> 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?
>
> That's what I expected and apparently I'm not the only one. But the
> actual code says that the default REAL is the 4 byte one, and if the
> compiler doesn't supply a float type of that size, the compiler crashes
> at startup.
That's a design mistake, though I can see how it happened. You do mean
4 byte, and not just REAL*4, though? If the latter, you can just make
REAL*4 mean your default real and have done with it! As I said, that
number is not always the size in bytes :-)
> Janne raises an interesting point, about Fortran requirements of int and
> float and double sizes that I was not aware of. Given those, it seems
> that the correct answer is to do the more traditional thing where "float"
> (REAL) is SFmode, 4 bytes -- always. In other words, make -mfloat32 be
> the only operating mode and retire that switch.
Not necessarily. Another option is to simply pad default INTEGER and
DOUBLE PRECISION - that's a common solution, and fully conforming. But
I don't know how hard that would be to do.
It's not relevant to the PDP11, but a lot of people feel that the correct
defaults for the modern world are 8 byte default integer and real, and
16 byte double precision.
Regards,
Nick Maclaren.
More information about the Fortran
mailing list