------- Comment #1 from steven at gcc dot gnu dot org  2008-01-03 21:51 -------
This is almost impossible to diagnose.  Do you know of any compiler that
detects this?

The only way I see to diagnose this, is to mark all do loop variables as such,
and warn about all assignments to such variables in contained functions.  But
that would result in false positives for e.g.

PROGRAM test
IMPLICIT NONE
INTEGER :: i
DO i=1,100
   CALL do_nothing()
ENDDO
CALL do_something()
CONTAINS
 SUBROUTINE do_something()
 IMPLICIT NONE
 DO i=1,10
 ENDDO
 END SUBROUTINE do_something
 SUBROUTINE do_nothing()
 IMPLICIT NONE
 END SUBROUTINE do_nothing
END PROGRAM test

which also seems undesirable... Thoughts?


-- 

steven at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2008-01-03 21:51:49
               date|                            |


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

Reply via email to