This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/53940] warn about duplicate USE
- From: "Bil.Kleb at NASA dot gov" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 12 Jul 2012 13:25:29 +0000
- Subject: [Bug fortran/53940] warn about duplicate USE
- Auto-submitted: auto-generated
- References: <bug-53940-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53940
--- Comment #2 from Bil Kleb <Bil.Kleb at NASA dot gov> 2012-07-12 13:25:29 UTC ---
I guess I see the USE ONLY as similar to a declaration, and to have two of the
same declarations in a program is an error, e.g.,
$ cat duplicate_declaration.f90 << EOF
program duplicate_declaration
integer :: var
integer :: var ! should produce at least a warning?
var = 1
print*, var
end program
EOF
% gfortran duplicate_declaration.f90
duplicate_declaration.f90:3.16:
integer :: var ! should produce at least a warning?
1
Error: Symbol 'var' at (1) already has basic type of INTEGER
While the error is mostly harmless, we find it useful to know about to keep our
code clean.