This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/25693] New: Missleading line number for 'unused variable' warnings
- From: "eedelman at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 6 Jan 2006 14:58:35 -0000
- Subject: [Bug fortran/25693] New: Missleading line number for 'unused variable' warnings
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The line number given in warning messages for unused variables in a procedure
with an internal procedure, is that of the first line of the internal
procedure, instead of the host procedure. I find this a bit confusing:
erik:~$ cat -n swap.f90
1 subroutine sort()
2 real :: a
3
4 contains
5
6 subroutine swap()
7 end subroutine swap
8
9 end subroutine sort
erik:~$ gfortran -Wall -c swap.f90
swap.f90: In function 'sort':
swap.f90:6: warning: unused variable 'a'
(The optimal thing would of course be to give the line where the variable was
declared, but since a variable can have several declarations (e.g. one for type
and a separate one for dimension), this is not allways possible.)
--
Summary: Missleading line number for 'unused variable' warnings
Product: gcc
Version: 4.2.0
Status: UNCONFIRMED
Keywords: diagnostic
Severity: minor
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: eedelman at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25693