public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/25693]  New: Missleading line number for  'unused variable' warnings
@ 2006-01-06 14:58 eedelman at gcc dot gnu dot org
  2006-01-06 15:02 ` [Bug fortran/25693] " pinskia at gcc dot gnu dot org
  2006-01-06 15:03 ` pinskia at gcc dot gnu dot org
  0 siblings, 2 replies; 3+ messages in thread
From: eedelman at gcc dot gnu dot org @ 2006-01-06 14:58 UTC (permalink / raw)
  To: gcc-bugs

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



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

* [Bug fortran/25693] Missleading line number for  'unused variable' warnings
  2006-01-06 14:58 [Bug fortran/25693] New: Missleading line number for 'unused variable' warnings eedelman at gcc dot gnu dot org
@ 2006-01-06 15:02 ` pinskia at gcc dot gnu dot org
  2006-01-06 15:03 ` pinskia at gcc dot gnu dot org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-01-06 15:02 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2006-01-06 15:01 -------
IIRC the issue is using warning instead of gfc_warning.  There is another bug
like this filed for arguments.


-- 


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



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

* [Bug fortran/25693] Missleading line number for  'unused variable' warnings
  2006-01-06 14:58 [Bug fortran/25693] New: Missleading line number for 'unused variable' warnings eedelman at gcc dot gnu dot org
  2006-01-06 15:02 ` [Bug fortran/25693] " pinskia at gcc dot gnu dot org
@ 2006-01-06 15:03 ` pinskia at gcc dot gnu dot org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-01-06 15:03 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pinskia at gcc dot gnu dot org  2006-01-06 15:02 -------
Actually the bug is for both,  This is a dup of bug 21918.

*** This bug has been marked as a duplicate of 21918 ***


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE


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



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

end of thread, other threads:[~2006-01-06 15:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-06 14:58 [Bug fortran/25693] New: Missleading line number for 'unused variable' warnings eedelman at gcc dot gnu dot org
2006-01-06 15:02 ` [Bug fortran/25693] " pinskia at gcc dot gnu dot org
2006-01-06 15:03 ` pinskia at gcc dot gnu dot org

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