[Bug fortran/31447] New: set intent(out) arguments to uninitialized
vivekrao4 at yahoo dot com
gcc-bugzilla@gcc.gnu.org
Mon Apr 2 20:51:00 GMT 2007
It would be nice if gfortran had an option to set intent(out) arguments to NaN
or some random values, so that code mistakenly relying on intent(out) arguments
starting with the same value as in the caller would be detected. This is
related to the question of detecting on uninitialized variables.
For example, the code
subroutine unset(i)
integer, intent(out) :: i
i = i*2
end subroutine unset
program xunset
integer :: i
i = 1
call unset(i)
print*,"i=",i
end program xunset
gives "i = 2" but the standard does not require that it do so, since argument i
has intent(out).
Vivek Rao
--
Summary: set intent(out) arguments to uninitialized
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Severity: enhancement
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: vivekrao4 at yahoo dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31447
More information about the Gcc-bugs
mailing list