flang icon indicating copy to clipboard operation
flang copied to clipboard

Adding intent(in)

Open dmikushin opened this issue 2 years ago • 3 comments
trafficstars

Planting intent(in) all over the code, per strict modern Fortran compilers requirements. Do not duplicate eq and == , ne and /= operators definitions, as they seem to be already aliases of each other, and compilers are not happy if we try to overdefine this fact.

dmikushin avatar Jun 26 '23 15:06 dmikushin

@dmikushin For reference, could you identify the code in flang1 that aliases operators .ne. etc. to /= etc.? Also, could you attach the binary output of compliing these files with and without the intent(in), to show that your change has no adverse impact on performance?

bryanpkc avatar Jul 25 '23 12:07 bryanpkc

@dmikushin gentle ping

bryanpkc avatar Oct 18 '23 11:10 bryanpkc

intent(in) is an element of Fortran interfaces design rules, such as iso_c_bindings. AFAIK, it does not change the compilation result, and focuses entirely on mandatory understanding by the developer his/her own code. The requirements used by PGI/Intel are in fact more liberal than the actual Fortran standard. So the main point of this PR is that its makes the code more standard-compliant, NFC.

dmikushin avatar Oct 18 '23 12:10 dmikushin