[PATCH, gfortran] Fix initialization of arrays of strings

Steve Kargl sgk@troutmask.apl.washington.edu
Mon Jul 11 16:25:00 GMT 2005


On Mon, Jul 11, 2005 at 02:40:01PM +0800, Feng Wang wrote:
> I think we should fix this in array.c (resolve_character_array_constructor).
> This is earlier than add_init_expr_to_sym. And we should also add it to the
> gfc_current_ns->cl_list to void memory leak. The list will be deallocated with
> the namespace.
> 

I don't understand what you want to do.  I just watched the
compiler go through resolve_character_array_constructor
and gfc_set_constant_character_len and it appears to do want
I would expect for the constant 'main  ' in the line 

   character(6) :: namest(0:50) = (/ ('main  ' , i = 0, 50) /)

My patch to add_init_expr_to_sym simply propagates the constant
'main  ' to the 51 elements of namest.

-- 
Steve



More information about the Gcc-patches mailing list