This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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: [gfortran] I/O of large integer and real kinds


On Mon, Jun 06, 2005 at 11:34:09PM +0200, FX Coudert wrote:
> +      *((GFC_REAL_4 *) dest) =
>  #if defined(HAVE_STRTOF)
>  	strtof (buffer, NULL);
>  #else
> -	(float) strtod (buffer, NULL);
> +	(GFC_REAL_4) strtod (buffer, NULL);

If you're going to pretend that GFC_REAL_4 is anything besides float,
then you need to use some mechanism to select the proper libc routine.
This is going to be all over libgfortran.

> +#if defined(HAVE_GFC_REAL_10) && defined (HAVE_STRTOLD)
> +    case 10:
> +      *((GFC_REAL_10 *) dest) = strtold (buffer, NULL);
> +      break;
> +#endif
> +#if defined(HAVE_GFC_REAL_16) && defined (HAVE_STRTOLD)
> +    case 16:
> +      *((GFC_REAL_16 *) dest) = strtold (buffer, NULL);
>        break;
> +#endif

There are targets for which both real10 and real16 exist.  Obviously,
only one of them corresponds to long double.  amd64-linux is one of
these; ia64-hpux is another.

This applies again when it comes to your shell script that creates
the typedefs.



r~


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