This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: single to double conversion


Brian Barnes wrote:

However, in g77, the real*4 of the function was 'detected' and
auto-promoted to real*8 in the subroutine.  There was loss of precision,
but that was not important to us.  The g77 compiler seemed to have no
problem at all in knowing that the precision of the subroutine and
function differed, and handling the difference gracefully.

gfortran, on the other hand, gives errant results for the real*8 variable,
and there is no possible warning by the compiler.  This comes back to my
original question:  if g77 handles this correctly, why does gfortan fail?

Sorry, but you persist in ignoring the fact that g77 works this way only when using the f2c compatibility option, where function results are passed as C double, because that is the way C worked when f2c was first developed. g77 is not recognizing the source code error and correcting it; it just happens to work that way on the platforms and with the options you chose to use.
I suspect it would be unacceptable to make the gfortran f2c compatibility option a default, if that is the "feature" you are requesting. The days of K&R C passed 15 years ago. You could still use g77 for a while if you insist it is the only true Fortran. Haven't I seen similar comments about several other compilers which have seen their day?



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]