[Rd] further f77/gfortran

Ben Bolker bolker at zoo.ufl.edu
Wed Jun 7 18:53:40 CEST 2006


Prof Brian Ripley wrote:

> We used to pick a F77 compiler first, but note that all legal F77 code
> is legal F95 code so there was no actual advantage is doing so.  The
> issue here is that your code is not legal F77, and g77 (which implements
> 'GNU Fortran') is letting it through.

   Not that it matters:

from  http://gcc.gnu.org/ml/fortran/2004-05/msg00308.html :

    /* We have overlapping initializers.  It could either be
+		       partially initilalized arrays (lagal), or the user
+		       specified multiple initial values (illegal).
+		       We don't implement this yet, so bail out.  */
+                  gfc_todo_error ("Initialization of overlapping
variables");

  so it's not clear to me whether my code is actually illegal,
or an odd case that gfortran doesn't handle ("yet") ...
the specific code that fails (as far as I can tell) is

      INTEGER SMALL(2)
      INTEGER LARGE(2)
      INTEGER RIGHT(2)
      INTEGER DIVER(2)
      INTEGER LOG10(2)
C
      REAL RMACH(5)
      SAVE RMACH
C
      EQUIVALENCE (RMACH(1),SMALL(1))
      EQUIVALENCE (RMACH(2),LARGE(1))
      EQUIVALENCE (RMACH(3),RIGHT(1))
      EQUIVALENCE (RMACH(4),DIVER(1))
      EQUIVALENCE (RMACH(5),LOG10(1))

http://www.fortran.com/F77_std/rjcnf-8.html#sh-8.2
  suggests this should be legal as long as REALs are twice as long
as INTEGERs?

  I'm on the edge of my knowledge here -- don't know if there's a better
idiom ...

   cheers
     Ben

-- 
620B Bartram Hall                            bolker at zoo.ufl.edu
Zoology Department, University of Florida    http://www.zoo.ufl.edu/bolker
Box 118525                                   (ph)  352-392-5697
Gainesville, FL 32611-8525                   (fax) 352-392-3704



More information about the R-devel mailing list