public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/64958] New: Warn if INTENT(IN) is changed by passing to no-intent argument
@ 2015-02-06 12:45 tkoenig at gcc dot gnu.org
  2015-02-06 12:45 ` [Bug fortran/64958] " tkoenig at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: tkoenig at gcc dot gnu.org @ 2015-02-06 12:45 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 64958
           Summary: Warn if INTENT(IN) is changed by passing to no-intent
                    argument
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tkoenig at gcc dot gnu.org

Consider the following code:

module foo
  implicit none
contains
  subroutine bar(n)
    integer, intent(in) :: n
    print *,"bar before dusty", n
    call dusty(n)
    print *,"bar after dusty", n
  end subroutine bar
end module foo

program main
  use foo
  implicit none
  integer :: n
  n = 5
  call bar(n)
end program main

subroutine dusty(n)
  integer n
  n = n - 1
end

What "dusty" does is illegal, but it may not be easy for the programmer
to catch this (especially if "dusty" is in a library).

So, it would be nice if -fcheck=all would contain a check which checked
if intent(in) dummy arguments are changed by being passed to
intent(none).


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

end of thread, other threads:[~2015-03-06 13:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-06 12:45 [Bug fortran/64958] New: Warn if INTENT(IN) is changed by passing to no-intent argument tkoenig at gcc dot gnu.org
2015-02-06 12:45 ` [Bug fortran/64958] " tkoenig at gcc dot gnu.org
2015-02-06 13:08 ` tkoenig at gcc dot gnu.org
2015-02-06 13:33 ` burnus at gcc dot gnu.org
2015-02-06 14:04 ` tkoenig at gcc dot gnu.org
2015-03-06 13:52 ` dominiq at lps dot ens.fr

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