public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "beliavsky at aol dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/31867] New: function result with character LEN computed at run time Date: Tue, 08 May 2007 15:28:00 -0000 [thread overview] Message-ID: <bug-31867-14444@http.gcc.gnu.org/bugzilla/> (raw) The program module util_mod implicit none contains function join(words,sep) result(str) ! trim and concatenate a vector of character variables, ! inserting sep between them character (len=*), intent(in) :: words(:),sep character (len=(size(words)-1)*len(sep) + sum(len_trim(words))) :: str integer :: i,nw nw = size(words) str = "" if (nw < 1) then return else str = words(1) end if do i=2,nw str = trim(str) // sep // words(i) end do end function join end module util_mod ! program xjoin use util_mod, only: join implicit none character (len=5) :: words(2) = (/"two ","three"/) write (*,"(1x,'words = ',a)") "'"//join(words," ")//"'" end program xjoin gives words = 'two threeg9' but I think it should give words = 'two three' gfortran -v says Using built-in specs. Target: i386-pc-mingw32 Configured with: ../trunk/configure --prefix=/mingw --enable-languages=c,fortran,c++,objc,obj-c++ --with-gmp=/home/coudert/local --disable-nls --with-ld=/mingw/bin/ld --with-as=/mingw/bin/as --disable-werror --enable-bootstrap --enable-threads --build=i386-pc-mingw32 --disable-shared --enable-libgomp Thread model: win32 gcc version 4.3.0 20070406 (experimental) -- Summary: function result with character LEN computed at run time Product: gcc Version: 4.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: beliavsky at aol dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31867
next reply other threads:[~2007-05-08 15:28 UTC|newest] Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top 2007-05-08 15:28 beliavsky at aol dot com [this message] 2007-05-09 0:10 ` [Bug fortran/31867] " jvdelisle at gcc dot gnu dot org 2007-05-09 0:33 ` jvdelisle at gcc dot gnu dot org 2007-05-09 6:33 ` burnus at gcc dot gnu dot org 2007-05-09 14:27 ` beliavsky at aol dot com 2007-05-10 11:34 ` burnus at gcc dot gnu dot org 2007-05-11 11:09 ` pault at gcc dot gnu dot org 2007-05-11 12:13 ` pault at gcc dot gnu dot org 2007-05-14 19:51 ` pault at gcc dot gnu dot org 2007-05-15 9:56 ` pault at gcc dot gnu dot org 2007-05-15 12:40 ` patchapp at dberlin dot org 2007-05-21 13:16 ` pault at gcc dot gnu dot org 2007-05-21 13:19 ` [Bug fortran/31867] [4.2 only] " pault at gcc dot gnu dot org 2007-05-31 18:51 ` pault at gcc dot gnu dot org 2007-05-31 18:53 ` pault at gcc dot gnu dot org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-31867-14444@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).