This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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]

A couple of issues


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


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