This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/35348] g77 fails to warn critical real/complex assignment errors



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]