Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!umd5!uflorida!novavax!proxftl!bill From: bill@proxftl.UUCP (T. William Wells) Newsgroups: comp.lang.c Subject: Re: C vs. FORTRAN Summary: I remember: chopping wood, walking miles through snow... Message-ID: <466@proxftl.UUCP> Date: 13 Jul 88 22:29:05 GMT References: <3136@phoenix.Princeton.EDU> <225800038@uxe.cso.uiuc.edu> <773@naucse.UUCP> Organization: Proximity Technology, Ft. Lauderdale Lines: 34 In article <773@naucse.UUCP>, rrr@naucse.UUCP (Bob Rose ) writes: ) In article <5234@ihlpf.ATT.COM>, nevin1@ihlpf.ATT.COM (00704a-Liber) writes: ) > Security in FORTRAN (with respect to calling conventions)?? Look at the ) > ) > subroutine foo(j) ) > j = 5 ) > end ) > ... ) > call foo(1) ) > ) > This passes through the compiler with no problem. If you look at the ) > run-time error, it's usually a memory violation and not a ) > compiler-generated error. Some security. ) ) ) Oh boy! You must be using some sort of new compiler. The old one's (not ) all of course) would after running this code change _all_ integer constants ) of value 1 to value 5. Try debugging the code after that occurs. ) -bob Back in the days of punch cards, I once substituted a `1' for an `I' in a subroutine call. This was not that hard to do given that they were just a shift away. And the printer on the keypunch wasn't that good; one could examine the print all day and not tell the difference. Of course the program acted really strange when the function modified that argument. Anyway, I spent THREE DAYS finding this. I finally found it by assuming that it was a compiler bug and doing the usual cut-out-code stuff. Of course, it wasn't a compiler bug, just a typo. Arg... Eighteen years later, I still remember. Anyway, it's things like that that have given, at least to me, call-by-reference as the default a bad odor.