Misuse of FORTRAN OUT parameter

A FORTRAN OUT parameter should not be read.

Marking a FORTRAN parameter as OUT indicates the intention that this argument should only be used to return a value, not to receive a value. FORTRAN OUT parameters are treated like uninitialized variables.

ID

Observation

Description

1

Uninitialized read

The place the OUT parameter was read

Examples


subroutine IHaveOutArgument(i)
integer, intent(out) :: i
i = i+1
! argument "i" is INTENT(OUT) dummy argument, but it is used before set
print *,i
end

integer :: j
call IHaveOutArgument(j)
print *,j
end
        

Copyright © 2010, Intel Corporation. All rights reserved.