This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/28004] Warn if intent(out) dummy variable is not set
- From: "fxcoudert at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 2 Nov 2006 09:47:08 -0000
- Subject: [Bug fortran/28004] Warn if intent(out) dummy variable is not set
- References: <bug-28004-1719@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from fxcoudert at gcc dot gnu dot org 2006-11-02 09:47 -------
(In reply to comment #1)
> I presented a patch for this problem and for detected unassigned r-values that
> was rejected. I don't know what to say; I think that it's a bug, in principle,
> but the standard does not require it.
Paul,
I looked at that bug again but couldn't find the patch you proposed. I think we
should issue a warning but not an error, because you can write code that is
still valid:
logical function foo(a, x)
integer,intent(in) :: a
integer,intent(out) :: x
foo = .false.
if (a > 0) then
foo = .true.
x = a
end if
end function foo
program test
integer :: a, x
a = -1
if (foo (a,x)) print *, x
end program test
--
fxcoudert at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |fxcoudert at gcc dot gnu dot
| |org
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2006-11-02 09:47:07
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28004