This is the mail archive of the 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/33529] New: problem with intrinsic function KIND

Ladies and Gentlemen:

In a module, before the CONTAINS statement, I have the following declaration:

  CHARACTER (OpconNameLength, ASCIICharacterKind), SAVE :: &
    CH_IMAG(UDDEFT) = "    "

where OpconNameLength, UDDEFT, are integer parameters. 

The parameter ASCIICharacterKind is defined as follows:

  integer(DefaultInteger), parameter :: ASCIICharacterKind = kind ("A")


  integer, parameter :: DefaultInteger = kind (1)

  Here is a module procedure in the same module:

  pure function getNickname_imer (TypeName) result (NickName)

    character (*, ASCIICharacterKind), intent(IN) :: TypeName
    character (IdLength, ASCIICharacterKind) :: NickName

    integer (DefaultInteger) :: K
    character (len(CH_IMAG), kind(CH_IMAG)) :: LName

    LName = adjustl (TypeName)
    K = UDType(LName)
    if (K /= 0) then
      NickName = UDNicknames(K)
      NickName = " "

  end function getNickname_imer

  Version 4.3.0 of the gfortran compiler is issuing the following error:


    character (len(CH_IMAG), kind(CH_IMAG)) :: LName
Error: Kind 0 is not a CHARACTER kind at (1)

  I do not believe this is an error. The following compilers compile this code:
Intel (Windows), Lahey (Linux, Windows), g95 (Linux) and NAG (Linux).

  Thank you for your attention.

Norm Clerman

           Summary: problem with intrinsic function KIND
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: clerman at fuse dot net

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