This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/53940] warn about duplicate USE


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]