public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* Fortran compilation bug
@ 2004-08-12 14:57 Michel Busquet
2004-08-16 21:49 ` James E Wilson
0 siblings, 1 reply; 2+ messages in thread
From: Michel Busquet @ 2004-08-12 14:57 UTC (permalink / raw)
To: gcc-bugs; +Cc: michel.busquet
The following source file produce an error at compilation time about
alleged "undefined length" string
Source file:
----------------
program a
character ch*10
ch='abcd'
call b(ch)
stop
end
c
subroutine b(ch)
character ch*(*)
integer i,l
do i=1,len(ch)
l=i
if(ch(i:i).eq.' ') goto 1
enddo
1 call C(ch(1:l)//'ok')
return
end
c
subroutine C(ch)
print *,ch
return
end
Compilation command line and messages :
-----------------------------------------------------------
$ g77 -o a.out a.f
a.f: In subroutine `b':
a.f:15:
1 call C(ch(1:l)//'ok')
1 2
Concatenation operator at (2) must operate on two scalar (not array)
subexpressions, two function invocations returning character scalars,
or a combination of both -- but the subexpression at (1) is of
indeterminate length
a.f: In subroutine `c':
a.f:15: warning:
1 call C(ch(1:l)//'ok')
1
a.f:19: (continued):
subroutine C(ch)
2
Argument #1 (named `ch') of `c' is one type at (2) but is some other
type at (1) [info -f g77 M GLOBALS]
Gcc Version:
-----------------
gcc -v
Reading specs from /usr/libexec/gcc/darwin/ppc/3.3/specs
Thread model: posix
gcc version 3.3 20030304 (Apple Computer, Inc. build 1495)
Platform and system:
----------------------------
iMac + Mac OS X 10.3
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Fortran compilation bug
2004-08-12 14:57 Fortran compilation bug Michel Busquet
@ 2004-08-16 21:49 ` James E Wilson
0 siblings, 0 replies; 2+ messages in thread
From: James E Wilson @ 2004-08-16 21:49 UTC (permalink / raw)
To: Michel Busquet (Forn_Natl); +Cc: michel.busquet, gcc-bugs
Michel Busquet (Forn_Natl) wrote:
> 1 call C(ch(1:l)//'ok')
> 1 2
> Concatenation operator at (2) must operate on two scalar (not array)
> subexpressions,
I don't get this error with gcc-3.4. Also, I don't get this error with
the fortran95 front end that will be in gcc-3.5. So it appears that
this problem has already been fixed.
--
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-08-16 21:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-12 14:57 Fortran compilation bug Michel Busquet
2004-08-16 21:49 ` James E Wilson
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).