This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/23635] New: Argument of ichar at (1) must be of length one
- From: "william dot mitchell at nist dot gov" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 30 Aug 2005 13:33:21 -0000
- Subject: [Bug fortran/23635] New: Argument of ichar at (1) must be of length one
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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