A couple of issues

Ignacio Fernández Galván jellby@yahoo.com
Tue Feb 13 11:52:00 GMT 2007


--- Ignacio Fernández Galván <jellby@yahoo.com> wrote:

What is the status of these items?

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

I failed to mention that in order to see the warning I have to compile
with -Wall.


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

So, it seems that the standard actually does allow this, but the
recognition of this by gfortran has to be improved, right?


I repeat the test program:

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


		
___________________________________________________________ 
What kind of emailer are you? Find out today - get a free analysis of your email personality. Take the quiz at the Yahoo! Mail Championship. 
http://uk.rd.yahoo.com/evt=44106/*http://mail.yahoo.net/uk 



More information about the Fortran mailing list