public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/53940] New: warn about duplicate USE
@ 2012-07-12 12:33 Bil.Kleb at NASA dot gov
  2012-07-12 13:09 ` [Bug fortran/53940] " burnus at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Bil.Kleb at NASA dot gov @ 2012-07-12 12:33 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 53940
           Summary: warn about duplicate USE
    Classification: Unclassified
           Product: gcc
           Version: 4.6.2
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: Bil.Kleb@NASA.gov


Hi,

I'd like to see the GFortran compiler at least give a warning if a USE is
duplicated, viz,

$ cat > duplicate_use.f90 << EOF
module mod
  integer :: var = 0
end module

program duplicate_use
  use mod, only: var
  use mod, only: var ! should produce error
  print*, var
end program
EOF

$ gfortran --version | head -1
GNU Fortran (GCC) 4.6.2 20111019 (prerelease)

$ gfortran -W -Wall -Wextra -pedantic-errors duplicate_use.f90
[no complaints]

The old DEC Alpha compiler does:

alpha% fort -what
    Compaq Fortran V1.2.0-1882
    Compaq Fortran Compiler V1.2.0-1882-48BBF

alpha% fort -c duplicate_use.f90
f90: Warning: duplicate_use.f90, line 6: Conflicting attributes or multiple
declaration of name.   [VAR]
  use mod, only: var
-----------------^
f90: Error: duplicate_use.f90, line 8: The same named entity from different
modules and/or program units cannot be referenced.   [VAR]
  print*, var
----------^

Thanks for consideration,
--
Bil


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

end of thread, other threads:[~2020-07-30 15:37 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-12 12:33 [Bug fortran/53940] New: warn about duplicate USE Bil.Kleb at NASA dot gov
2012-07-12 13:09 ` [Bug fortran/53940] " burnus at gcc dot gnu.org
2012-07-12 13:25 ` Bil.Kleb at NASA dot gov
2012-07-12 13:45 ` [Bug fortran/53940] Optionally warn about multiple explicit USE-association of the same symbol burnus at gcc dot gnu.org
2014-05-19 16:03 ` Joost.VandeVondele at mat dot ethz.ch
2015-10-13 16:28 ` dominiq at lps dot ens.fr
2020-07-30 15:37 ` 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).