|
Authored by: Wol on Thursday, November 08 2012 @ 02:40 PM EST |
Hmmm... I think you're missing something.
An integer may have been four bytes long. It was passed into the routine where N
was an integer. HOWEVER what IANALitj is saying is that whatever the variable
was in the calling program, it was a real.
FORTRAN (by default, like C) assumes the user knows what they're doing. The
call*er* passed a four-byte REAL on the stack. The call*ee* received a four-byte
INTEGER on the stack. BOOM. There would not have been any integrity checks to
make sure that what was passed matched what was expected.
I used various (proprietary) options in my IV and 77 code, most noticeably the
IMPLICIT statement, and the -DCLVAR compiler option. The former changed the
default typing - I think I declared O and P as double, and Q as boolean. The
DCLVAR compiler option disabled implicit typing. I know that sounds strange -
set up an implicit then disable it - but because I stuck to those typing rules,
it then meant anybody looking at my code could be fairly confident of the
variable type without having to dig through all the declarations to make sure. I
used DCLVAR mainly to catch typos :-)
Cheers,
Wol[ Reply to This | Parent | # ]
|
|
|
|
|