This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/30955] intrinsic: FGET
- From: "tkoenig at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 25 Feb 2007 15:56:27 -0000
- Subject: [Bug fortran/30955] intrinsic: FGET
- References: <bug-30955-13648@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from tkoenig at gcc dot gnu dot org 2007-02-25 15:56 -------
> $> gfortran-svn fget.f90 && ./a.out
> x
> x
>
> I.e. the string is cleared and the first character is set to the input.
> This also "works" with substrings, e.g. s(3:6).
> In my eyes I would consider the blanking the bug, not that a string is allowed.
> Consistent behaviour should overwrite the first character, not ALL of them.
>
This is expected behavior, and is consistent with both g77
(for which we support fget, as a legacy intrinsic)
and with the way that character assignment works.
$ cat fget.f
character*10 s
s = '0123456789'
CALL fget(s)
write(*,*) s
s = '0123456789'
s = 'ab'
write (*,*) s,'x'
end
$ g77 fget.f && ./a.out
xxx
x
ab x
> 3. The optional status argument accepts variables of type default integer only.
Fget is a legacy intrinsic, and there are now standard ways
of achieving the same result (stream I/O). Also, g77 only
accepts default integers as well.
I'd vote for fixing the argument name, and leave the rest alone.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30955