public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/33529]  New: problem with intrinsic function KIND
@ 2007-09-22 16:31 clerman at fuse dot net
  2007-09-23  9:08 ` [Bug fortran/33529] Non-litteral CHARACTER kind values matching is wrong fxcoudert at gcc dot gnu dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: clerman at fuse dot net @ 2007-09-22 16:31 UTC (permalink / raw)
  To: gcc-bugs

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")

and 

  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)
    else
      NickName = " "
    endif

  end function getNickname_imer

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

/home/norm/design/source/chrimerM.f90:912.42:

    character (len(CH_IMAG), kind(CH_IMAG)) :: LName
                                         1
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


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


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

* [Bug fortran/33529] Non-litteral CHARACTER kind values matching is wrong
  2007-09-22 16:31 [Bug fortran/33529] New: problem with intrinsic function KIND clerman at fuse dot net
@ 2007-09-23  9:08 ` fxcoudert at gcc dot gnu dot org
  2007-10-04 15:08 ` fxcoudert at gcc dot gnu dot org
  2007-10-04 15:09 ` fxcoudert at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2007-09-23  9:08 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from fxcoudert at gcc dot gnu dot org  2007-09-23 09:08 -------
$ cat u.f90 
  character (kind=kind("a")) :: u
  end
$ gfortran u.f90 
u.f90:1.27:

  character (kind=kind("a")) :: u
                          1
Error: Kind 0 is not a CHARACTER kind at (1)


-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |fxcoudert at gcc dot gnu dot
                   |dot org                     |org
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
           Keywords|                            |rejects-valid
      Known to fail|                            |4.3.0
   Last reconfirmed|0000-00-00 00:00:00         |2007-09-23 09:08:14
               date|                            |
            Summary|problem with intrinsic      |Non-litteral CHARACTER kind
                   |function KIND               |values matching is wrong
   Target Milestone|---                         |4.3.0


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


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

* [Bug fortran/33529] Non-litteral CHARACTER kind values matching is wrong
  2007-09-22 16:31 [Bug fortran/33529] New: problem with intrinsic function KIND clerman at fuse dot net
  2007-09-23  9:08 ` [Bug fortran/33529] Non-litteral CHARACTER kind values matching is wrong fxcoudert at gcc dot gnu dot org
@ 2007-10-04 15:08 ` fxcoudert at gcc dot gnu dot org
  2007-10-04 15:09 ` fxcoudert at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2007-10-04 15:08 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from fxcoudert at gcc dot gnu dot org  2007-10-04 15:08 -------
Subject: Bug 33529

Author: fxcoudert
Date: Thu Oct  4 15:08:14 2007
New Revision: 129012

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=129012
Log:
        PR fortran/33529

        * decl.c (match_char_kind): New function.
        (match_char_spec): Use match_char_kind.

        * gfortran.dg/char_type_len_2.f90: Adjust error message.
        * gfortran.dg/char_decl_2.f90: New test.

Added:
    trunk/gcc/testsuite/gfortran.dg/char_decl_2.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/decl.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gfortran.dg/char_type_len_2.f90


-- 


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


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

* [Bug fortran/33529] Non-litteral CHARACTER kind values matching is wrong
  2007-09-22 16:31 [Bug fortran/33529] New: problem with intrinsic function KIND clerman at fuse dot net
  2007-09-23  9:08 ` [Bug fortran/33529] Non-litteral CHARACTER kind values matching is wrong fxcoudert at gcc dot gnu dot org
  2007-10-04 15:08 ` fxcoudert at gcc dot gnu dot org
@ 2007-10-04 15:09 ` fxcoudert at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2007-10-04 15:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from fxcoudert at gcc dot gnu dot org  2007-10-04 15:09 -------
Fixed on mainline. Thanks for the bug report, and please reopen this one or
open a new one if you still experience problems.


-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fxcoudert at gcc dot gnu dot
                   |                            |org
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


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


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

end of thread, other threads:[~2007-10-04 15:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-09-22 16:31 [Bug fortran/33529] New: problem with intrinsic function KIND clerman at fuse dot net
2007-09-23  9:08 ` [Bug fortran/33529] Non-litteral CHARACTER kind values matching is wrong fxcoudert at gcc dot gnu dot org
2007-10-04 15:08 ` fxcoudert at gcc dot gnu dot org
2007-10-04 15:09 ` fxcoudert 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).