GNU Fortran Compiler
Jan Zywiel
JZywiel@applanix.com
Mon Nov 29 07:18:00 GMT 1999
Hello,
I am trying to compile some old Fortran code using a g77 compiler under
Redhat Linux 6.1 (the file used to install the compiler was
egcs-g77-1.1.2-24.i386.rpm). I have come across two problems which are
described below. Please let me know if these are real problems, or am I
doing something wrong.
Problem 1:
The compiler does not seem to recognize the syntax for direct access READ
statement.
A line of code:
read(ich1,rec = nrec1,end = 100) (bufd(i),i=1,npr1)
produced the following compiler error diagnostics:
rddat.f: In subroutine `rddat':
rddat.f:166:
read(ich1,rec = nrec1,end = 100) (bufr(i),i=1,npr1)
1 2
Conflicting I/O control specifications at (1) and (2)
make: *** [rddat.o] Error 1
Is this a bug? Does g77 handle direct IO differently? I could not find
anything on IO in the g77 manual at
http://egcs.cygnus.com/onlinedocs/g77_toc.html .
If I modify the code to be:
read(ich1,rec=nrec1) (bufd(i),i=1,npr1)
or
read(ich1,rec=nrec1,err=100) (bufd(i),i=1,npr1)
then it compiles correctly. Nevertheless, it would be nice to handle the end
of file condition.
Problem 2:
The command line switch '-l' does not seem to be handled correctly. A
command like
f77 -o executable object1.o object2.o ... -llibrary
produced an error message indicating that "-llibrary" was not found, while
f77 -o executable object1.o object2.o ... library
worked fine.
Best regards,
Jan Zywiel
More information about the Gcc-bugs
mailing list