This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
A couple of issues
- From: Ignacio Fernández Galván <jellby at yahoo dot com>
- To: fortran at gcc dot gnu dot org
- Date: Wed, 31 Jan 2007 17:41:46 +0000 (GMT)
- Subject: A couple of issues
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=HmJCU8LYZTft132Dpz/xwIQYEcqQPp2YzdHLvl/L5vFkO6TORYGordWAsgMye9rbks+4v7rp1mMbyU/XMTldy1OZls1mhZmQ9uIQqOh8DRQgDHltYN2uiiJhDCCyYDtoTZVmeti5i2Bzf5BWve4zS5Q77Ud24slZIJcQ2/4IqiE=;
Hi all,
Consider the included test program at the end. The first thing is I get
a warning for:
b=c%nom(1:2)
1
Warning: rhs of CHARACTER assignment at (1) will be truncated (10/2)
but I don't see anything should be truncated. It remains silent with
"b=a(1:2)", so it must be something with the custom type.
The second thing, is that, compiling with -std=f95 or -std=f2003, I get
this error:
Bij=RESHAPE((/ 1.0D0,3.0D0,3.0D0, &
1
Error: Extension: Evaluation of nonstandard initialization expression
at (1)
but nothing for Aij. It works fine with -std=gnu or -std=legacy. Is
there something in the standard preventing "reshape" for real variables
and alowing it for integers?
Thans in advance
Ignacio
PROGRAM test
IMPLICIT NONE
TYPE custom
CHARACTER(LEN=10) :: nom
END TYPE custom
CHARACTER (LEN=10) :: a
CHARACTER (LEN=2) :: b
TYPE(custom) :: c
INTEGER, DIMENSION(3,3), PARAMETER :: &
Aij=RESHAPE((/ 1,3,3, &
3,2,2, &
3,2,2 /), (/3,3/))
DOUBLE PRECISION, DIMENSION(3,3), PARAMETER :: &
Bij=RESHAPE((/ 1.0D0,3.0D0,3.0D0, &
3.0D0,2.0D0,2.0D0, &
3.0D0,2.0D0,2.0D0 /), (/3,3/))
a='1234567890'
b=a(1:2)
c%nom=a
b=c%nom(1:2)
END PROGRAM test
___________________________________________________________
The all-new Yahoo! Mail goes wherever you go - free your email address from your Internet provider. http://uk.docs.yahoo.com/nowyoucan.html