This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/54597] New: Function can't return string without trailing spaces
- From: "dongli at lasg dot iap.ac.cn" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 16 Sep 2012 05:51:17 +0000
- Subject: [Bug fortran/54597] New: Function can't return string without trailing spaces
- Auto-submitted: auto-generated
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: unassigned@gcc.gnu.org
ReportedBy: dongli@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.