public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/41604] Reject result with assumed-length character in INTERFACE decl
       [not found] <bug-41604-4@http.gcc.gnu.org/bugzilla/>
@ 2013-06-23 14:31 ` dominiq at lps dot ens.fr
  0 siblings, 0 replies; 3+ messages in thread
From: dominiq at lps dot ens.fr @ 2013-06-23 14:31 UTC (permalink / raw)
  To: gcc-bugs

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

Dominique d'Humieres <dominiq at lps dot ens.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-06-23
     Ever confirmed|0                           |1

--- Comment #3 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Still present at revision 200321.


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

* [Bug fortran/41604] Reject result with assumed-length character in INTERFACE decl
  2009-10-06 14:43 [Bug fortran/41604] New: " burnus at gcc dot gnu dot org
  2009-10-06 15:32 ` [Bug fortran/41604] " burnus at gcc dot gnu dot org
@ 2009-10-07  8:09 ` burnus at gcc dot gnu dot org
  1 sibling, 0 replies; 3+ messages in thread
From: burnus at gcc dot gnu dot org @ 2009-10-07  8:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from burnus at gcc dot gnu dot org  2009-10-07 08:09 -------
Actually, according to a note (cf. PR 41603 comment 5) the interface actually
could be valid - as long it is not used.

While invoking the function directly is properly rejected, e.g. the following
  c = assumed_len(5)

using it as dummy is accepted:

 module funcs
   implicit none
   integer, parameter :: dp = kind(0.0)
   interface
      function assumed_len(x)
         character(*) assumed_len
         integer, intent(in) :: x
      end function assumed_len
   end interface
contains
  subroutine foo(x)
    procedure(assumed_len) :: x !!! Invalid?!
    ! Check also using an "interface" directly
  end subroutine
  subroutine test()
    call foo(assumed_len)
  end subroutine test
end module funcs



NAG f95 rejects it with:
Error: line 12: ASSUMED_LEN has an implicit interface, therefore it cannot be
used as a proc-interface

while Ifort as mentioned above already does not like the interface.

F95 had Note 5.6 (which is no longer in F2003):

  "An interface body may be specified for a dummy or external function
   whose result has a character length parameter of * only if the function
   is not invoked. This is because this characteristic has to be specified
   to be the same in the interface body as in the procedure definition, but
   in order to invoke such a procedure, the calling routine is required to
   specify a length other than *."


-- 


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


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

* [Bug fortran/41604] Reject result with assumed-length character in INTERFACE decl
  2009-10-06 14:43 [Bug fortran/41604] New: " burnus at gcc dot gnu dot org
@ 2009-10-06 15:32 ` burnus at gcc dot gnu dot org
  2009-10-07  8:09 ` burnus at gcc dot gnu dot org
  1 sibling, 0 replies; 3+ messages in thread
From: burnus at gcc dot gnu dot org @ 2009-10-06 15:32 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from burnus at gcc dot gnu dot org  2009-10-06 15:31 -------
Actually, if one tries to use the function, one also gets with gfortran an
error message:

   c = assumed_len(5)
       1
Error: Function 'assumed_len' is declared CHARACTER(*) and cannot be used at
(1) since it is not a dummy argument


-- 


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


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

end of thread, other threads:[~2013-06-23 14:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-41604-4@http.gcc.gnu.org/bugzilla/>
2013-06-23 14:31 ` [Bug fortran/41604] Reject result with assumed-length character in INTERFACE decl dominiq at lps dot ens.fr
2009-10-06 14:43 [Bug fortran/41604] New: " burnus at gcc dot gnu dot org
2009-10-06 15:32 ` [Bug fortran/41604] " burnus at gcc dot gnu dot org
2009-10-07  8:09 ` burnus 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).