octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #51961] integer argument size conflict in ranl


From: Mike Miller
Subject: [Octave-bug-tracker] [bug #51961] integer argument size conflict in ranlib when building with 64-bit Fortran support
Date: Thu, 7 Sep 2017 18:42:14 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0

URL:
  <http://savannah.gnu.org/bugs/?51961>

                 Summary: integer argument size conflict in ranlib when
building with 64-bit Fortran support
                 Project: GNU Octave
            Submitted by: mtmiller
            Submitted on: Thu 07 Sep 2017 03:42:13 PM PDT
                Category: Libraries
                Severity: 4 - Important
                Priority: 5 - Normal
              Item Group: Segfault, Bus Error, etc.
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: dev
        Operating System: GNU/Linux

    _______________________________________________________

Details:

When building with 64-bit Fortran indexing, there is a conflict between some
of the function arguments in liboctave/external/ranlib and the calling
prototypes declared in C.

In C:


F77_RET_T F77_FUNC (getsd, GETSD) (F77_INT4&, F77_INT4&);
F77_RET_T F77_FUNC (setall, SETALL) (const F77_INT4&, const F77_INT4&);
F77_RET_T F77_FUNC (setcgn, SETCGN) (const F77_INT4&);
F77_RET_T F77_FUNC (setsd, SETSD) (const F77_INT4&, const F77_INT4&);


But in Fortran the arguments are declared as plain INTEGER types.

I've worked around this with the following patch


diff --git a/liboctave/external/ranlib/getcgn.f
b/liboctave/external/ranlib/getcgn.f
--- a/liboctave/external/ranlib/getcgn.f
+++ b/liboctave/external/ranlib/getcgn.f
@@ -1,5 +1,5 @@
       SUBROUTINE getcgn(g)
-      INTEGER g
+      INTEGER*4 g
 C**********************************************************************
 C
 C      SUBROUTINE GETCGN(G)
diff --git a/liboctave/external/ranlib/getsd.f
b/liboctave/external/ranlib/getsd.f
--- a/liboctave/external/ranlib/getsd.f
+++ b/liboctave/external/ranlib/getsd.f
@@ -30,7 +30,7 @@ C     .. Parameters ..
       PARAMETER (numg=32)
 C     ..
 C     .. Scalar Arguments ..
-      INTEGER iseed1,iseed2
+      INTEGER*4 iseed1,iseed2
 C     ..
 C     .. Scalars in Common ..
       INTEGER a1,a1vw,a1w,a2,a2vw,a2w,m1,m2
diff --git a/liboctave/external/ranlib/setall.f
b/liboctave/external/ranlib/setall.f
--- a/liboctave/external/ranlib/setall.f
+++ b/liboctave/external/ranlib/setall.f
@@ -31,7 +31,7 @@ C     .. Parameters ..
       PARAMETER (numg=32)
 C     ..
 C     .. Scalar Arguments ..
-      INTEGER iseed1,iseed2
+      INTEGER*4 iseed1,iseed2
       LOGICAL qssd
 C     ..
 C     .. Scalars in Common ..
diff --git a/liboctave/external/ranlib/setsd.f
b/liboctave/external/ranlib/setsd.f
--- a/liboctave/external/ranlib/setsd.f
+++ b/liboctave/external/ranlib/setsd.f
@@ -30,7 +30,7 @@ C     .. Parameters ..
       PARAMETER (numg=32)
 C     ..
 C     .. Scalar Arguments ..
-      INTEGER iseed1,iseed2
+      INTEGER*4 iseed1,iseed2
 C     ..
 C     .. Scalars in Common ..
       INTEGER a1,a1vw,a1w,a2,a2vw,a2w,m1,m2


I don't remember how portable the INTEGER*N syntax is, I don't know if we want
to keep these source files pristine, or if there's a cleaner solution, like
overriding the FFLAGS for just the libranlib source files.




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?51961>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]