On Sat, Nov 26, 2016 at 7:03 PM, Janus Weil <ja...@gcc.gnu.org> wrote: > 2016-11-26 17:58 GMT+01:00 Janus Weil <ja...@gcc.gnu.org>: >>>> * possibly add some more cross-links to intrinsic.texi >>> >>> Could you please elaborate? >> >> I just mean it might be useful to add some more links from LTIME to >> ITIME, IDATE and DATE_AND_DATE (and back?). They are are all very >> similar. > > Sorry, I meant DATE_AND_TIME here. > > >>> Well LTIME cannot accept both kind(4) and kind(8) arguments. The reference >>> to TIME8 looks like a mistake, isn’t it? >> >> Huh, in libgfortran I see two versions with different kinds (ltime_i4 >> and ltime_i8), but in my tests I never get LTIME to work with kind=8 >> arguments. I guess that is the real bug here ... > > I think the origin of the bug is: > > void > gfc_resolve_ltime (gfc_code *c) > { > c->resolved_sym > = gfc_get_intrinsic_sub_symbol (gfc_get_string (PREFIX ("ltime_i%d"), > gfc_default_integer_kind)); > } > > > This always uses the ITIME version corresponding to > gfc_default_integer_kind, disregarding the actual kind of the > arguments. > > Cheers, > Janus
LTIME, ITIME, TIME, TIME8, IDATE are g77 intrinsics, from back before newfangled things like kinds. So there are versions for integer kind=4 and kind=8 due to -fdefault-integer-8. DATE_AND_TIME is different since it's in the current standard and IIRC is specified to work with any integer kind. -- Janne Blomqvist