5 ms·
A very quick google didn't make it obvious how Fortran avoids this issue. Can anyone explain?
by tgb 12y ago
A very quick google didn't make it obvious how Fortran avoids this issue. Can anyone explain?
- robmccoll 12y agoFortran has bound arrays and more explicit pointers. If bounds checking isn't enabled, it is still possible for some level of aliasing to happen, but it would most likely be an error, not the intention of the programmer. In general, there are far fewer places in Fortran code where the compiler must make the assumption that array references could be aliases of each other.
- noahl 12y agoI believe the Fortran standard requires that all function arguments point to non-overlapping pieces of memory. Therefore, the compiler can assume that pointers don't alias when compiling. If you choose to pass arguments that do alias to a function, that becomes your problem.