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]

Re: f951: Segmentation fault, gfortran 4.8.1


I believe the segfault has been fixed for GCC 4.9.

Daniel Molina wrote:
The completed output is this
$ LANG=en gfortran getopt_long.F03
getopt_long.F03:277.36:
   type(getopt_type), pointer :: self
                                     1
Error: Symbol 'self' at (1) already has basic type of REAL

To compile the code with GCC 4.9, I have to change:

character(len=getopt_argv_len(self,argn)) &
function getopt_argv(self,argn) result(argv)
...

to
function getopt_argv(self,argn) result(argv)
...
  integer, intent(in) :: argn
  character(len=getopt_argv_len(self,argn)) :: argv

(I believe your version is invalid according to the Fortran standard.) Then it compiles. (With GCC 4.8, it shows no error, but still segfaults.)


Note: gfortran 4.9 also warns:
      status=.false.
  if (present(status)) status=.true.
                              1
Warning: Extension: Conversion from LOGICAL(4) to INTEGER(4) at (1)

Tobias


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