RFC: Setting some intrinsics as GFC_STD_LEGACY

Manfred Schwarb manfred99@gmx.ch
Tue Mar 13 14:16:00 GMT 2007


Brooks,

> One thing I've noticed, in checking the documentation for intrinsic 
> functions, is that there are quite a number of them that we really only 
> have for backwards-compatibility reasons.  Most of them are things that 
> G77 supported, but which now have equivalent (or better) analogues in 
> standard Fortran.
> 
> These, it would seem to me, exactly fit the criteria for GFC_STD_LEGACY 
> distinction.  However, they're currently all set to GFC_STD_GNU.
> 
> Should I expect any odd side effects from putting GFC_STD_LEGACY in the 
> relevant flag in the add_sym calls?  Would anyone have any objections to 
> me doing this?
> 

Hmm, I'm not entirely happy with it (not that it would matter though).
Four points come to mind:

1) I thought the idea was that code written in some sort of
   old-style-but-sane-f77-code should be compilable by gfortran 
   without any additional flags (ease-transition-from-g77 argument).
   Some/many of these intrinsics are not invented by g77, but 
   are (were) common intrinsics of some other compilers, e.g. vax fortran.
   Well, for me it's not a demand, I don't mind adding some additional
   flags, but there should be a consensus probably.

2) If doing so there is a problem to distinguish between ugly code and
   such legacy intrinsics. When adding -std=legacy then some ugly 
   things like
      real r
      do r=1.0,2.0
        print*,r
      enddo
      end
   are not catched any more. I think legacy intrinsics and ugly code
   should be kept separated. And adding -std=g77 is probably not a
   very appealing solution.

3) While looking at the manpage for -std=...: The description seems
   not very clear. There probably should be a listing of all possible
   arguments (i.e. std=[legacy,f95,f2003,gnu]), one has to collect them
   over the whole section now. Additionally it's not clear whether 
   "conform" means warnings or errors.

4) while trying my above example, I noticed that
      real r
      do r=1.0,2.0
        print*,r
      enddo
      end
   gives a warning, however
      do r=1.0,2.0
        print*,r
      enddo
      end
  i.e. implicitely typed "r", gives no warning.
  I will look at the bugzilla, and if I don't find anything matching,
  I will fill a new report.

> - Brooks

regards,
Manfred



-- 
"Feel free" - 10 GB Mailbox, 100 FreeSMS/Monat ...
Jetzt GMX TopMail testen: www.gmx.net/de/go/mailfooter/topmail-out



More information about the Fortran mailing list