[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference turris::fortran

Title:Digital Fortran
Notice:Read notes 1.* for important information
Moderator:QUARK::LIONEL
Created:Thu Jun 01 1995
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:1333
Total number of notes:6734

1201.0. "f77 -o foo.f foo.f : aie !" by BACHUS::SABLON (Mich�le Sablon, TP/IM Support Belgium 856-7238) Wed Feb 26 1997 10:56

UNIX V4.0-B
dfa401

	While, by error, you give as output file name the name of the input 
	file, guess what ? 

		INPUT FILE IS OVERWRITTEN !!!

	On UNIX ! No version => NO SOURCE ANYMORE.

	On UNIX V4.0 only. On V3.2-* it returns error message:

	cc: Error: -o toto.f resembles the name of a source file, disallowed
	fort: Severe: Failed while trying to link.

	Same version (401) on both systems. But cc does effectively generates 
	the error. So I suppose it is not ld that has the problem.

Sad !
Mich�le.
T.RTitleUserPersonal
Name
DateLines
1201.1QUARRY::nethCraig NethWed Feb 26 1997 13:0116
Let me preface this by saying I'm sorry you lost your source file.  

What is happening is that the f77(1) driver program calls the cc(1) driver
program to perform the link.   The cc driver program used to do a minimal
number of checks like this (including some undesirable/wrong ones).

In V4.0, a lot of cleanup was done in the cc driver to make it more
maintainable.    The cc driver thought it knew how to compile Fortran
files (it didn't - what was in there was left over from the MIPS days)
and so in V4.0 I took out all of that cruft.    

Feel free to file a QAR against cc if you think this is a regression
that should be fixed (or you could ask the Fortran people to do such
checks before it hands things off to cc).

Craig
1201.2f90 and f77 could do what cc doesTLE::WHITLOCKStan WhitlockWed Feb 26 1997 16:1522
Since it is only the "-o filename" switch that lets the user name an output
file from the f90 or f77 driver, we could check the suffix on "filename" and
give a warning {like cc does} if the suffix if .f, .for, or .FOR.  I suppose
for completeness with Fortran's use of cpp we should include .F and .i.  Note
that cc's message

	> cc -o y.c y.c
	> cc: Error: -o y.c resembles the name of a source file, disallowed
	> cc -o z.c y.c
	> cc: Error: -o z.c resembles the name of a source file, disallowed

can't be overridden {ie, it always abort the compilation} and it happens even if
the output file {"z.c" in the second example} doesn't exist.  If cc can live
with that, I guess so can I.

Note that f90 and f77 call cc and cc checks for outputs file suffixes .c and
.s so Fortran doesn't have to.

So I'll add this to the list of nice features to do to the f90 and f77 drivers
someday - no promise when, though.

/Stan
1201.3O/S chauvanism warning! :-)GIDDAY::GILLINGSa crucible of informative mistakesWed Feb 26 1997 18:055
  Upgrade to OpenVMS! ;-)

  With version numbers you won't lose your original file.

						John Gillings, Sydney CSC
1201.4Is QAR still needed ?BACHUS::SABLONMich�le Sablon, TP/IM Support Belgium 856-7238Thu Feb 27 1997 12:0211
.1 :	Thanks for your explannation, Craig. And don't be too sorry: it was 
	not too bad as it happens during a migration : they could find the
	source back.

.2 :	Stan, should I, however, enter some QAR of any sort ?

.3 :	Don't convince me, John, but I'm afraid religious war is over, and VMS
	lost... But so did the Germains and the Japaneses !...

Best,
Mich�le.
1201.5a QAR is not neededTLE::WHITLOCKStan WhitlockThu Feb 27 1997 14:046
>>.2 :	Stan, should I, however, enter some QAR of any sort ?

No, please do not submit a QAR.  The improvement is already on our list to
think about.

Thanks			/Stan