Wrong warnings with g77-20001106

Martin Kahlert martin.kahlert@infineon.com
Tue Nov 7 06:36:00 GMT 2000


Hi,
g77 from gcc-20001106 produces (incorrect) warnings about
unused Variables:

      SUBROUTINE F
      COMMON /NAM/ Y, I
      INTEGER*4 I
      REAL*8 Y

      Y = 1D0

      RETURN
      END

g77 -Wall -c prog.f
says:
prog.f: In subroutine `f':
prog.f:9: warning: unused variable `i'
prog.f:9: warning: unused variable `y'

Since these vars are inside a *named* common block, there may
be situations, where the setting y = 1 is useful and not unused. ;-)

I hope, that the compiler doesn't omit the assignment, because
it assumes that it's unneccessary.

Bye, Martin.



More information about the Gcc-bugs mailing list