public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/23635] New: Argument of ichar at (1) must be of length one
@ 2005-08-30 13:41 william dot mitchell at nist dot gov
  2005-08-30 15:25 ` [Bug fortran/23635] " fxcoudert at gcc dot gnu dot org
  0 siblings, 1 reply; 3+ messages in thread
From: william dot mitchell at nist dot gov @ 2005-08-30 13:41 UTC (permalink / raw)
  To: gcc-bugs

Compiler reports a string must be of length one, but the string is of length one.

Fedora Core 1.  Verbose output of compiler:

mitchell@looneyjr> gfortran -c -v icharbug.f90
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../gcc-4.0.1/configure
--prefix=/local/home/mitchell/tmp/gcc-4.0.1-install
-with-local-prefix=/local/home/mitchell/tmp/gcc-4.0.1-include
Thread model: posix
gcc version 4.0.1
 /local/home/mitchell/tmp/gcc-4.0.1-install/libexec/gcc/i686-pc-linux-gnu/4.0.1/f951
icharbug.f90 -quiet -dumpbase icharbug.f90 -mtune=pentiumpro -auxbase icharbug
-version -o /tmp/cc3fxHyh.s
GNU F95 version 4.0.1 (i686-pc-linux-gnu)
        compiled by GNU C version 4.0.1.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
 In file icharbug.f90:13

   temp(i) = ichar(ptr%addr(i:i))
                  1
Error: Argument of ichar at (1) must be of length one

Since I don't see how to attach a file on this bugzilla web page for reporting
bugs, and this bug has a short program that demonstrates it, I am just putting
the text of the program here:

module icharbug_mod

type glcptr
   character(len=4) :: addr
end type glcptr

contains

subroutine icharbug(ptr)
type(glcptr), intent(in) :: ptr
integer :: i, temp(4)
do i=1,4
   temp(i) = ichar(ptr%addr(i:i))
end do
end subroutine icharbug

end module icharbug_mod

-- 
           Summary: Argument of ichar at (1) must be of length one
           Product: gcc
           Version: 4.0.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: william dot mitchell at nist dot gov
                CC: gcc-bugs at gcc dot gnu dot org


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


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

* [Bug fortran/23635] Argument of ichar at (1) must be of length one
  2005-08-30 13:41 [Bug fortran/23635] New: Argument of ichar at (1) must be of length one william dot mitchell at nist dot gov
@ 2005-08-30 15:25 ` fxcoudert at gcc dot gnu dot org
  0 siblings, 0 replies; 3+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2005-08-30 15:25 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From fxcoudert at gcc dot gnu dot org  2005-08-30 15:23 -------
Confirmed. Reduced testcase:

  type glcptr
    character(len=2) :: addr
  end type glcptr

  type(glcptr) :: ptr
  print *, ichar(ptr%addr(1:1))
  end

The type declaration is needed to exhibit the bug, and the fact that addr is not
of length 1 is needed: it looks like the check for the argument of ichar is not
done on ptr%addr(1:1) but on ptr%addr (which is not of length 1).

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2005-08-30 15:23:30
               date|                            |


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


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

* [Bug fortran/23635] Argument of ichar at (1) must be of length one
       [not found] <bug-23635-11265@http.gcc.gnu.org/bugzilla/>
@ 2005-10-20 17:33 ` pinskia at gcc dot gnu dot org
  0 siblings, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-10-20 17:33 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pinskia at gcc dot gnu dot org  2005-10-20 17:33 -------
I have a fix which I am testing.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |pinskia at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED


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


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

end of thread, other threads:[~2005-10-20 17:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-30 13:41 [Bug fortran/23635] New: Argument of ichar at (1) must be of length one william dot mitchell at nist dot gov
2005-08-30 15:25 ` [Bug fortran/23635] " fxcoudert at gcc dot gnu dot org
     [not found] <bug-23635-11265@http.gcc.gnu.org/bugzilla/>
2005-10-20 17:33 ` pinskia 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).