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/27997] Fortran 2003: Support type-spec for array constructor



------- Comment #12 from d at domob dot eu  2008-03-25 17:10 -------
(In reply to comment #11)
> Sounds like the right place. Care should be taken because lengths are not
> required to be constants, like in the following:
> 
>   call foo(8, "short")
>   call foo(2, "lenghty")
> contains
>   subroutine foo(n,s)
>     character(len=*) s
>     integer n
>     print *, [ character(len=n) :: 'test', s ]
>   end subroutine
> end

Well, I'm not sure if the patch I've got in mind would handle this...  I'm
thinking of padding string literals shorter than the array's length at compile
time when this length is constant.

For non-constant lengths I suppose a runtime call would be needed to pad
correctly?  Is this important or should I first make constant lengths work?


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27997


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