New intrinsics: ChDir, IErrNo, Link, Rename, Sleep, and SymLnk
Steve Kargl
sgk@troutmask.apl.washington.edu
Wed Jan 26 00:09:00 GMT 2005
On Wed, Jan 26, 2005 at 12:42:08AM +0100, coudert@lcp.u-psud.fr wrote:
>
> I implemented a few g77 intrinsics. Bootstrapped, regtested and tested all
> those new intrinsics on i686-linux. At the end of this mail is the diff in
> current state; I will wait for comments before calling it a patch.
I'll try to look over your patch this weekend.
> * For a subroutine like kill (not yet implemented), which has 3 integers
> arguments, should I implement kill_i4_i4_i4 and all other 7 possibilities
> or use m4 (which I don't yet really understand, but I'll work on that)?
g77.info states
CALL Kill(PID, SIGNAL, STATUS)
PID: `INTEGER'; scalar; INTENT(IN).
SIGNAL: `INTEGER'; scalar; INTENT(IN).
STATUS: `INTEGER(KIND=1)'; OPTIONAL; scalar; INTENT(OUT).
So, status is alway integer(4). However, I think you'll need
kill_i4_i4_i4 and kill_i8_i8_i8 because of the -i8 and -d8
options. Then, in your resolve function, you can cross promote
the appropriate type. You'll want code like
int kind;
kind = max_kind(pid,signal);
if (pid->ts.kind != kind) gfc_convert_type();
if (signal->ts.kind != kind) gfc_convert_type();
etc.
You may also want to check out how Paul rewrote part of my patch
2004-12-02 Steven G. Kargl <kargls@comcast.net>
Paul Brook <paul@codesourcery.com>
* check.c (gfc_check_flush, gfc_check_fnum): New functions.
(gfc_check_fstat, gfc_check_fstat_sub): New functions.
(gfc_check_stat, gfc_check_stat_sub): New functions.
etc.
I originally wrote the patch for integer(4) only (I misunderstood
g77.info). Paul fixed the patch for other integer kinds.
--
Steve
More information about the Fortran
mailing list