3 ms·
Arguments are allowed to alias if they are both inputs that will not be changed in the function -- technically if they are both "intent(in)".
by Bostonian 3y ago
Arguments are allowed to alias if they are both inputs that will not be changed in the function -- technically if they are both "intent(in)".
- pklausler 3y agoINTENT(IN) is not required to allow aliasing of unmodified dummy arguments.
- kergonath 3y agoYes, but in practice no compiler checks whether an argument with no INTENT is modified or not, or could alias with something else or not. So the compilers tend to trust the programmer. With INTENTS, it’s obvious and much easier to check.
- pklausler 3y agoDummy argument aliasing has nothing to do with INTENT.
- TheRealKing 3y agoI believe the NAG Fortran compiler does check for some aliasing scenarios if not all. The argument intent is irrelevant.