Bug ID: 91442
           Summary: Wrong "may be used uninitialized" warning with
                    allocation on assignment
           Product: gcc
           Version: 8.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot
          Reporter: jellby at yahoo dot com
  Target Milestone: ---

Simple test case:

program test
character(len=:), allocatable :: string
string='Hello world!'
write(6,*) string
end program

Compile with "-Wall":



Warning: ‘.string’ may be used uninitialized in this function

Adding "-O1" removes the warning, though.

Reply via email to