public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/30955]  New: intrinsic: FGET
@ 2007-02-25  0:10 dfranke at gcc dot gnu dot org
  2007-02-25 15:56 ` [Bug fortran/30955] " tkoenig at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2007-02-25  0:10 UTC (permalink / raw)
  To: gcc-bugs

subroutine = {
        name = 'fget';
        arg  = 'count';
        arg  = 'status';                   /* optional */

        call = 'CALL fget(count = char)';
        call = 'CALL fget(count = char, status = int_1)';
        call = 'CALL fget(count = char, status = int_2)';
        call = 'CALL fget(count = char, status = int_4)';
        call = 'CALL fget(count = char, status = int_8)';
};

1. The argument name of the first dummy argument name is "count", documented is
"c. Neither one is very descriptive for fget, IMO plain "c" is better than
"count"
2. The first argument shall accept only CHARACTER, but CHARACTER(*) is also
allowed:

$> cat fget.f90
character(len=10) :: s
s = '0123456789'
CALL fget(s)
write(*,*) s
end
$> 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.

3. The optional status argument accepts variables of type default integer only.


-- 
           Summary: intrinsic: FGET
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dfranke at gcc dot gnu dot org
OtherBugsDependingO 30932
             nThis:


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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug fortran/30955] intrinsic: FGET
  2007-02-25  0:10 [Bug fortran/30955] New: intrinsic: FGET dfranke at gcc dot gnu dot org
@ 2007-02-25 15:56 ` tkoenig at gcc dot gnu dot org
  2007-02-25 16:12 ` dfranke at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2007-02-25 15:56 UTC (permalink / raw)
  To: gcc-bugs



------- 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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug fortran/30955] intrinsic: FGET
  2007-02-25  0:10 [Bug fortran/30955] New: intrinsic: FGET dfranke at gcc dot gnu dot org
  2007-02-25 15:56 ` [Bug fortran/30955] " tkoenig at gcc dot gnu dot org
@ 2007-02-25 16:12 ` dfranke at gcc dot gnu dot org
  2007-03-17 11:38 ` fxcoudert at gcc dot gnu dot org
  2010-05-13 13:50 ` dfranke at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2007-02-25 16:12 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from dfranke at gcc dot gnu dot org  2007-02-25 16:11 -------
There's is/was a discussion at the ML whether GNU extensions should allow
default integer only, fold anything into a default integer and recast
afterwards or whether the library shall provide calls for any type.

As far as I can tell, currently all of above schemes are implemented for one
intrinsic or another. There was no agreement yet, how to proceed. For more
details, see also PR30372 and the thread starting at
http://gcc.gnu.org/ml/fortran/2007-02/msg00538.html

Personally, I don't mind too much which scheme is implemented, as long as it's
consistent for ALL intrinsic procedures ...


-- 


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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug fortran/30955] intrinsic: FGET
  2007-02-25  0:10 [Bug fortran/30955] New: intrinsic: FGET dfranke at gcc dot gnu dot org
  2007-02-25 15:56 ` [Bug fortran/30955] " tkoenig at gcc dot gnu dot org
  2007-02-25 16:12 ` dfranke at gcc dot gnu dot org
@ 2007-03-17 11:38 ` fxcoudert at gcc dot gnu dot org
  2010-05-13 13:50 ` dfranke at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2007-03-17 11:38 UTC (permalink / raw)
  To: gcc-bugs



-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |diagnostic
      Known to fail|                            |4.1.3 4.2.0 4.3.0
   Last reconfirmed|0000-00-00 00:00:00         |2007-03-17 11:37:50
               date|                            |


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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug fortran/30955] intrinsic: FGET
  2007-02-25  0:10 [Bug fortran/30955] New: intrinsic: FGET dfranke at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2007-03-17 11:38 ` fxcoudert at gcc dot gnu dot org
@ 2010-05-13 13:50 ` dfranke at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: dfranke at gcc dot gnu dot org @ 2010-05-13 13:50 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from dfranke at gcc dot gnu dot org  2010-05-13 13:50 -------
This (a) didn't turn out as much of an issue and (b) the general problem is
known. Closing this specific incarnation as WONTFIX.


-- 

dfranke at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |WONTFIX


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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-05-13 13:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-25  0:10 [Bug fortran/30955] New: intrinsic: FGET dfranke at gcc dot gnu dot org
2007-02-25 15:56 ` [Bug fortran/30955] " tkoenig at gcc dot gnu dot org
2007-02-25 16:12 ` dfranke at gcc dot gnu dot org
2007-03-17 11:38 ` fxcoudert at gcc dot gnu dot org
2010-05-13 13:50 ` dfranke at gcc dot gnu dot org

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).