------- Comment #2 from burnus at gcc dot gnu dot org  2006-12-17 21:20 -------
> As long as the callee doesn't change the value it's probably valid, so this
> would need some kind of interprocedural analysis to give a correct error.

I think it is formally seen invalid as you have INTENT([IN]OUT) set.

Actually, I just retested with NAG f95 and it gives:
Error: test.f90, line 5: Active DO variable I passed to INTENT(OUT) argument I
number 1 of MYSUB

We could nontheless consider of giving a warning only, if you think the case of
INTENT(OUT) with no assignment is much more common than a wrongly used
do-variable.

By the way, if no value is assigned to an INTENT(OUT) variable, gfortran should
follow the other compilers and issue a warning:
"INTENT(OUT) dummy argument I never set"
"INTENT(OUT) variable 'i' at (1) is never set"
"A dummy argument with an explicit INTENT(OUT) declaration is not given an
explicit value."


-- 


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

Reply via email to