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]

confusion in intrinsic.c with actual args and elemental fcns


Paul,

I'm reviewing FX patch that implements another round of
g77 intrinsic procedures.  In looking at intrinsics.c,
I think we have some confusion with respect to intrinsic
procedures that are elemental and intrinsic procedures
that can be actual arguments.  For example, we have

  add_sym_1 ("besj0", 1, 0, BT_REAL, dr, GFC_STD_GNU,
	     gfc_check_g77_math1, NULL, gfc_resolve_g77_math1,
	     x, BT_REAL, dr, REQUIRED);

j0 bessel fcn is an elemental function but can't be used as
an actual arg.

  add_sym_1 ("getcwd", 0, 1, BT_INTEGER, di,  GFC_STD_GNU,
	     NULL, NULL, gfc_resolve_getcwd,
	     c, BT_CHARACTER, dc, REQUIRED);

getcwd is not an elemental function, but it can be an actual arg.

  add_sym_0 ("getgid", 1, 0, BT_INTEGER, di, GFC_STD_GNU,
	     NULL, NULL, gfc_resolve_getgid);

getgid is an elemental function but can't be used as an actual arg.

In looking at FX's patch I see

+  add_sym_1 ("hostnm", 0, 1, BT_INTEGER, di, GFC_STD_GNU,
+	     gfc_check_hostnm, NULL, gfc_resolve_hostnm,
+	     a, BT_CHARACTER, dc, REQUIRED);
+
+  make_generic ("hostnm", GFC_ISYM_HOSTNM, GFC_STD_GNU);
+
 
+  add_sym_0 ("ierrno", 1, 0, BT_INTEGER, di, GFC_STD_GNU,
+	     NULL, NULL, gfc_resolve_ierrno);
+
+  make_generic ("ierrno", GFC_ISYM_IERRNO, GFC_STD_GNU);
+
 
+  add_sym_2 ("kill", 1, 1, BT_INTEGER, di, GFC_STD_GNU,
+	     gfc_check_kill, NULL, gfc_resolve_kill,
+	     a, BT_INTEGER, di, REQUIRED, b, BT_INTEGER, di, REQUIRED);
+
+  make_generic ("kill", GFC_ISYM_KILL, GFC_STD_GNU);


This doesn't seem correct.  What is your take on what we
should be doing with the elemental and actual argument
fields?

-- 
Steve


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