This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/14568] New: Gfortran should not warn about unused variables in common blocks
- From: "schnetter at aei dot mpg dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 13 Mar 2004 10:23:01 -0000
- Subject: [Bug fortran/14568] New: Gfortran should not warn about unused variables in common blocks
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Gfortran should not warn about unused variables in common blocks. (Unless,
possibly, the whole common block is unused.) The following piece of code
shows the problem:
subroutine a
implicit none
integer b, c
common /block/ b, c
c = 1
end subroutine a
The compiler says
$ ~/gcc-3.5-tree-ssa/bin/gfortran -S unusedcommon.f90 -Wall
unusedcommon.f90: In function `a':
unusedcommon.f90:1: warning: unused variable `b'
My build is
$ ~/gcc-3.5-tree-ssa/bin/gfortran -v
Reading specs
from /home/eschnett/gcc-3.5-tree-ssa/lib/gcc/i686-pc-linux-gnu/3.5-tree-ssa/specs
Configured with: ../gcc/configure --prefix=/home/eschnett/gcc-3.5-tree-ssa
--enable-languages=c,c++,f95
Thread model: posix
gcc version 3.5-tree-ssa 20040312 (merged 20040307)
--
Summary: Gfortran should not warn about unused variables in
common blocks
Product: gcc
Version: tree-ssa
Status: UNCONFIRMED
Severity: minor
Priority: P2
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: schnetter at aei dot mpg dot de
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14568