4 ms·
Fortran actually passes by value-return, or whatever you call it, not by reference. The call may still be compiled by reference, of course, and it used to be f
by gnufx 5y ago
Fortran actually passes by value-return, or whatever you call it, not by reference. The call may still be compiled by reference, of course, and it used to be fun to change the value of a number in the days when it wasn't in read-only storage.
- bregma 5y ago"Fun" in the Dwarf Fortress sense. We once spent days trying to track down an obscure malfunction only to discover that someone had passed a 0 literal as an actual parameter to a certain function that assigned 4 to the formal parameter. For those following along at home, that meant the value of any 0 literal in the program suddenly became 4.
- gnufx 5y agoI don't know what Dwarf Fortress is, but that's what I meant. Fortran now has INTENT specifiers, and you can expect constants to live in .rodata(?) on ELF systems, so you get a SEGV if you evade any compiler warning.