3 ms·
I was under the impression that inadvertently causing aliasing via by-ref arguments in Fortran is also effectively UB, and any diagnostics that compilers might
by int_19h 4y ago
I was under the impression that inadvertently causing aliasing via by-ref arguments in Fortran is also effectively UB, and any diagnostics that compilers might produce are best-effort and will not catch non-trivial cases.
- lmm 4y agoProbably the real difference is that Fortran compiler culture is to do the right thing for UB rather than screwing over the programmer.
- int_19h 4y agoWhat would the "right thing" be in this case, in cases where the compiler cannot detect at compile-time? Will it actually check all variables in scope for aliasing when entering the function?
- lmm 4y agoIf your pointers turn out to overlap then maybe you get "impossible" stale reads or something, but you don't get demons flying out of your nose like in C.