public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/37999]  New: Fortran shape and kind intrinsic
@ 2008-11-02 23:35 carbess at swcp dot com
  2008-11-03  0:01 ` [Bug fortran/37999] " kargl at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: carbess at swcp dot com @ 2008-11-02 23:35 UTC (permalink / raw)
  To: gcc-bugs

Shape intrinsic does not allow scalar arguments as required by f90/f95/f03
standards. Example code follows:
program test_shape ! Segmentation fault generated when executable executed
   integer :: i
   print *, shape( i )  ! Shape of a scalar allowed by f90, f95, f03
                        ! standards.
end program test_shape


Kind intrinsic with character argument in type declaration fails: Example
follows:
! Compiler version:
! GNU Fortran (GCC) 4.2.4 (Ubuntu 4.2.4-1ubuntu3)
! Copyright (C) 2007 Free Software Foundation, Inc.

character (len = 3, kind = kind("a" )  c  ! Compiler fails with internal error
-- invalid syntax
! character (len = 3, kind = kind("a") )  c  ! Fails compilation -- invalid
kind
!                                              value returned -- that is, minus
!                                              integer huge.  Notice the
!                                              kind("a") is correctly returned
!                                              as 1 in print statement below
and
!                                              kind=1 works in a character
!                                              declaration.
! character (len = 3, kind = 1)  c  ! Works

   c = "b"
   print *, kind("a"), c
end program


-- 
           Summary: Fortran shape and kind intrinsic
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: carbess at swcp dot com


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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-11-11  5:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-02 23:35 [Bug fortran/37999] New: Fortran shape and kind intrinsic carbess at swcp dot com
2008-11-03  0:01 ` [Bug fortran/37999] " kargl at gcc dot gnu dot org
2008-11-03 16:33 ` carbess at swcp dot com
2008-11-03 18:43 ` kargl at gcc dot gnu dot org
2008-11-03 22:18 ` burnus at gcc dot gnu dot org
2008-11-11  5:29 ` jvdelisle at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).