http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54597

             Bug #: 54597
           Summary: Function can't return string without trailing spaces
    Classification: Unclassified
           Product: gcc
           Version: 4.7.1
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: fortran
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: don...@lasg.iap.ac.cn


I would like to write a function that will return string without trailing
spaces, the prototype of the function is as following:

module mod

contains

    function foo()

        character(*), allocatable :: foo
        character(1000) bar

        bar = "abc"
        foo = bar

    end function foo

end module mod

program main

    use mod

    write(*, *) """", foo(), """"

end program main

The result of "gfortran" still contains trailing spaces, but "ifort" works as
expected.

Reply via email to