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/30865] optional argument passed on to size(...,dim=)



------- Comment #2 from burnus at gcc dot gnu dot org  2007-02-20 08:57 -------
> The following is legal but we segfault on execution:

>  subroutine checkv(ires,a1,opt1)
>    integer :: a1(:,:)
>    integer, optional :: opt1
>    ires = size (a1, dim=opt1)

For those who wonder (as I did) why using an optional argument is legal:
It is only used as actual argument corresponding to an optional dummy argument.
(cf. 12.4.1.6 in the Fortran 2003 standard).


-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |burnus at gcc dot gnu dot
                   |                            |org


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


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