[net.bugs] Bug in f77 compiler

cmoore@amdimage.UUCP (chris moore) (04/24/85)

I have discovered what appears to be a bug in the f77 compiler
running under 4.2bsd.  Has anyone else encountered this, and
is there a fix for it?

Description:
	A fortran program compiled with 'f77 -c' and then
	passed through 'ld' will not have units 5 and 6
	attached to stdin and stdout.
Reconstruct by:
	Write a program such as:
		write(6,10)
	    10  format('hello')
		stop
	and do an f77 <file>.f
	Running a.out prints 'hello' correctly.
	Now compile using f77 -c <file>.f and then
	ld <file>.o
	Running a.out prints nothing, and the output goes
	into fort.6

I tried doing explicit opens on units 5 and 6 (open (6,'/dev/tty'))
and I keep getting 'Illegal Argument' on the opens.

Any suggestions would be much appreciated.

			Chris Moore
			amdimage!cmoore
-- 

Of course we have backup tapes.  Do you want last year or the
 year before?

 Chris Moore (408) 749-4692
 UUCP: {ucbvax,decwrl,ihnp4,allegra}!amdcad!amdimage!cmoore

darryl@ISM780.UUCP (04/26/85)

[]

Admittedly, f77 does have a number of bugs, but I don't believe that this
is one of them.  I haven't checked this out, so I'm leeping before looking
here...  When you link using ld explicitly, you ought to consider using
the flags -lF77 and -lI77.  It sounds like you aren't getting the needed
runtime startup code that hides in /usr/lib/libI77.a.  This is why it is
advisable to link using the language command (cc or f77, for example)
rather than doing it on your own -- the compiler knows more about the
expected environment (usually) than you do.

	    --Darryl Richman, INTERACTIVE Systems Corp.
	    ...!cca!ima!ism780!darryl
	    The views expressed above are my opinions only.