public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/103418] New: random_number() does not accept pointer, intent(in) array argument
@ 2021-11-24 20:59 baradi09 at gmail dot com
  2021-11-24 21:41 ` [Bug fortran/103418] " anlauf at gcc dot gnu.org
                   ` (15 more replies)
  0 siblings, 16 replies; 17+ messages in thread
From: baradi09 at gmail dot com @ 2021-11-24 20:59 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103418

            Bug ID: 103418
           Summary: random_number() does not accept pointer, intent(in)
                    array argument
           Product: gcc
           Version: 10.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: baradi09 at gmail dot com
  Target Milestone: ---

The following module is, at least according to the discussion on
fortran-lang.discourse
(https://fortran-lang.discourse.group/t/meaning-of-the-intent-for-pointer-dummy-arguments/2328/11)
is standard complying, but gfortran stops with an error message when compiling
it. Someone in that topic also posted a gcc-patch, which may fix the issue.

Code:

module m
contains
   subroutine s1(a)
      real, pointer, intent(in) :: a
      call s2(a )           !<-- Ok with gfortran
      call random_number(a) !<-- but not this
   end subroutine
   subroutine s2(x)
      real, intent(out) :: x
      call random_number(x)
   end subroutine
end module

Error message:

bug3.f90:6:25:

    6 |       call random_number(a) !<-- but not this
      |                         1
Error: ‘harvest’ argument of ‘random_number’ intrinsic at (1) cannot be
INTENT(IN)

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

end of thread, other threads:[~2021-12-27 20:35 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-24 20:59 [Bug fortran/103418] New: random_number() does not accept pointer, intent(in) array argument baradi09 at gmail dot com
2021-11-24 21:41 ` [Bug fortran/103418] " anlauf at gcc dot gnu.org
2021-11-24 22:10 ` anlauf at gcc dot gnu.org
2021-11-24 23:27 ` kargl at gcc dot gnu.org
2021-11-25 21:02 ` anlauf at gcc dot gnu.org
2021-11-25 21:07 ` sgk at troutmask dot apl.washington.edu
2021-11-25 22:10 ` anlauf at gcc dot gnu.org
2021-11-25 22:18 ` sgk at troutmask dot apl.washington.edu
2021-11-25 23:19 ` sgk at troutmask dot apl.washington.edu
2021-11-26 19:27 ` sgk at troutmask dot apl.washington.edu
2021-11-26 20:13 ` anlauf at gcc dot gnu.org
2021-11-26 21:58 ` sgk at troutmask dot apl.washington.edu
2021-12-05 21:55 ` anlauf at gcc dot gnu.org
2021-12-10 18:07 ` cvs-commit at gcc dot gnu.org
2021-12-19 21:20 ` cvs-commit at gcc dot gnu.org
2021-12-27 20:33 ` cvs-commit at gcc dot gnu.org
2021-12-27 20:35 ` anlauf at gcc dot gnu.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).