This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/45170] [F2003] allocatable character lengths
- From: "burnus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 15 May 2012 12:54:36 +0000
- Subject: [Bug fortran/45170] [F2003] allocatable character lengths
- Auto-submitted: auto-generated
- References: <bug-45170-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45170
--- Comment #34 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-05-15 12:54:36 UTC ---
(In reply to comment #24)
> call hello(ceiling(11*rnd),string)
That should be floor or "10" - otherwise, it can give "11" which is too large.
(Or and better: Change the "10" to "11" below then "hello worl(d)" fits into
the string.)
> integer,intent(in)::n
> character(10)::helloworld="hello world"
> string=helloworld(:n) ! Does not work.
Interestingly, it works if one does not use "n" as argument but sets it in the
procedure. One then gets code like:
*string = ... __builtin_malloc ( ... MAX_EXPR <n, 0> )
However, if "n" is passed as dummy argument, one has:
integer(kind=4) D.1865;
*string = ... __builtin_malloc ( ... MAX_EXPR <D.1865, 0> )
D.1865 = *nnnn;
Or in other words: The order is wrong.