This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
bug with optional argument
- From: Vivek Rao <vivekrao4 at yahoo dot com>
- To: fortran at gcc dot gnu dot org
- Date: Tue, 6 Dec 2005 12:15:55 -0800 (PST)
- Subject: bug with optional argument
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=LCa72VIzrJiPZE9SP6vMv8S9QSookHAOIUMzzC38bc5S6hNudDMe1f5+wP3LDVQi/UXmoggieDgwZMqkCoqi8jT8izbftO7SiFSLnAsrcN+qrRipMMMWGYD9qW4eKCwnvx9NaP1bFtw4BrGdVrxvfxOaBfCs/VseKGhQi2jW3oo= ;
Compiling the source
module print_array_mod
implicit none
private
public :: print_sub
integer, private, parameter :: istd_output = 6
contains
subroutine print_sub(labels,fmt_labels,fmt_header)
character (len=*) , intent(in) :: labels(:)
character (len=*) , intent(in) ::
fmt_labels
character (len=*) , intent(in), optional ::
fmt_header
if (present(fmt_header)) then
if (fmt_header /= "") write
(istd_output,fmt_header)
end if
write (istd_output,fmt_labels) labels
end subroutine print_sub
end module print_array_mod
with gfortran
gcc version 4.2.0 20051126 (experimental)
with the default options on Windows XP
gives the error message
print_array_gfort.f90: In function 'print_sub':
print_array_gfort.f90:11: internal compiler error:
tree check: expected integer_cst, have plus_expr in
gfc_trans_transfer, at fortran/trans-io.c:1804
If someone confirms this bug and/or enters it in
bugzilla, please inform me. Thanks.
Vivek Rao