------- Comment #4 from burnus at gcc dot gnu dot org 2006-11-03 19:59 ------- > I think we should issue a warning but not an error, because you can write code > that is [...] Note that you should use "contains" for the code otherwise "foo" is regarded as real function and the program does not compile.
g95 actually gives only a warning if the variable is not set at all, it does not give a warning, if it is only set in the if branch. So does ifort. (NAG f95 and sunf95 don't give any warning neither with assigning it in the if branch or not assigning it at all.) Using -Wall gfortran states that the variable "x" is not used, but a default warning that "A dummy argument with an explicit INTENT(OUT) declaration is not given an explicit value." is more helpful. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28004