This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/31447] New: set intent(out) arguments to uninitialized
- From: "vivekrao4 at yahoo dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 2 Apr 2007 20:51:19 -0000
- Subject: [Bug fortran/31447] New: set intent(out) arguments to uninitialized
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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