[Bug fortran/30799] New: Inconsistent handling of bad (invalid) LOGICAL kinds

anlauf at gmx dot de gcc-bugzilla@gcc.gnu.org
Wed Feb 14 22:17:00 GMT 2007


Hi,

the following invalid code shows that gfortran does not reject
bad kinds for logicals:

program gfcbug57
  implicit none
  !
  ! These are logical kinds known by gfortran and many other compilers:
  !
  print *, kind (.true._1)          ! This prints "1"
  print *, kind (.true._2)          ! This prints "2"
  print *, kind (.true._4)          ! This prints "4"
  print *, kind (.true._8)          ! This prints "8"
  !
  ! These are very strange (read: bad (invalid?)) logical kinds,
  ! handled inconsistently by gfortran (there's no logical(kind=0) etc.)
  !
  print *, kind (.true._0)          ! This prints "0"
  print *, kind (.true._3)          ! This prints "3"
  print *, kind (.true._123)        ! This prints "123"
  !
  ! Here gfortran bails out with a runtime error:
  !
  print *, .true._3                 ! "Internal Error: bad integer kind"
end program gfcbug57


Cheers,
-ha


-- 
           Summary: Inconsistent handling of bad (invalid) LOGICAL kinds
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: anlauf at gmx dot de
  GCC host triplet: i686-pc-linux-gnu


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



More information about the Gcc-bugs mailing list