https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67884

            Bug ID: 67884
           Summary: Missing error message on required allocatable
                    attribute
           Product: gcc
           Version: 5.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gerhard.steinmetz.fort...@t-online.de
  Target Milestone: ---

This definition of f is incomplete :

$ cat z2a.f90
program p
   integer i
   print *, [(f(i), i=1,3)]
contains
   function f(n)
      integer :: n
      character(:) :: f
      character(3) :: c = 'abc'
      f = c(n:n)
   end
end

$ gfortran -g -O0 -Wall -fcheck=all z2a.f90
$ a.out


With additional/different options other effects may occur.
Only sometimes. Needs running a.out many times.
For example :

$ gfortran -g -O0 -fcheck=all -fstack-protector z2a.f90
$ a.out
Operating system error: Cannot allocate memory
Memory allocation failed

Reply via email to