This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [gfortran] add ISATTY and TTYNAM intrinsics
- From: Tobias dot Schlueter at Physik dot Uni-Muenchen dot DE
- To: fxcoudert at gmail dot com
- Cc: fortran at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Tue, 9 Aug 2005 18:05:14 +0200
- Subject: Re: [gfortran] add ISATTY and TTYNAM intrinsics
(Again, sorry for breaking threading)
:REVIEWURL http://gcc.gnu.org/ml/gcc-patches/2005-08/msg00410.html:
Fracois-Xavier Coudert wrote:
> Attached patch (with testcase and ChangeLog entries) adds g77 ISATTY and
TTYNAM
> intrinsics to gfortran.
>
> Built and regtested on i686-linux. OK for mainline and 4.0?
Not yet, because I see a few minor issues.
> GFC_LOGICAL_8
> isatty_i8 (GFC_INTEGER_8 *unit)
> {
> gfc_unit *u;
>
> u = find_unit (*unit);
> if (u != NULL)
> return (GFC_LOGICAL_8) stream_isatty (u->s);
> else
> return 0;
> }
This only works on low-endian systems: find_unit expects an int argument. I'd
suggest changing the unit argument to type int *, changing the resolution to
convert the argument to use gfc_c_int_kind, and changing the other
implementation functions accordingly.
Thanks,
- Tobi