This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/35348] g77 fails to warn critical real/complex assignment errors
- From: "kargl at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 24 Feb 2008 17:42:26 -0000
- Subject: [Bug fortran/35348] g77 fails to warn critical real/complex assignment errors
- References: <bug-35348-15817@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from kargl at gcc dot gnu dot org 2008-02-24 17:42 -------
FX is correct with respect to assignment of a complex expression
to a real variable. See page 141 of the F2003 standard especially
table 7.9.
real x
complex :: z = (1,-1)
x = z
end
The 'x = z' is treated as if you wrote 'x = real(z,kind(x))'
As to the subroutine problem, your program is technically
illegal for at least one reasone. You've never assigned
a value to CA(2), so you're not allowed to reference it.
To avoid these types of issues if make the subroutine an
internal subprogram or use an explicit interface for the
subroutine.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35348