Path: utzoo!utgpu!water!watmath!clyde!bellcore!rutgers!mit-eddie!ll-xn!ames!lll-tis!oodis01!uplherc!sp7040!obie!wes From: wes@obie.UUCP (Barnacle Wes) Newsgroups: comp.lang.c Subject: Re: C vs. FORTRAN Summary: On some machines, this will break the program! Message-ID: <96@obie.UUCP> Date: 9 Jul 88 18:41:13 GMT References: <3136@phoenix.Princeton.EDU> <225800038@uxe.cso.uiuc.edu> <5234@ihlpf.ATT.COM> Organization: the Well of Souls Lines: 25 In article <5234@ihlpf.ATT.COM>, nevin1@ihlpf.ATT.COM (00704a-Liber) writes: > 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. On the IBM 360 Fortran IV compiler, this would have the nasty effect of making all future references to 1 come out 5. The 360 instruction set did not have any operations with immediate operands, so the Fortran compiler would create a data area with "Define Constant" declarations for each and every constant in the program. If you choose to put another value in your constants, that was your problem, not the compilers, or the computers. Like the old adage: "Constants aren't and variables won't." -- {hpda, uwmcsd1}!sp7040!obie!wes "Happiness lies in being priviledged to work hard for long hours in doing whatever you think is worth doing." -- Robert A. Heinlein --