Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add implicit none to example programs that do not have it #780

Merged

Conversation

gareth-nx
Copy link
Contributor

This adds implicit none to a number of programs in the example folder that otherwise don't have it.

While not essential, the programs are used in library documentation, and IMO it's better to demonstrate good practice.

I have run the tests using cmake --build build --target test and they all appear to pass.

Copy link
Member

@jvdp1 jvdp1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @gareth-nx . I agree that it is better to demonstrate good practice.
I wonder if it might be even better to use implicit none (type, external) rather implicit none. Or would it exclude too many compilers that do not support this more recent feature?

@gareth-nx
Copy link
Contributor Author

Thanks for the review @jvdp1.

I actually haven't moved to using implicit none(type, external) in my own programs.

From this link I understand that the main difference relates to external functions and subroutines.

In the context of the example programs, these are probably moot points. But so was the absence of implicit none, as it turned out.

The bigger question is whether we should uniformly encourage implicit none (type, external) as the default, rather than just implicit none.

I'm not sure. But maybe if there are doubts about compiler support, we can just leave it for now?

@jvdp1
Copy link
Member

jvdp1 commented Apr 3, 2024

I'm not sure. But maybe if there are doubts about compiler support, we can just leave it for now?

OK. We can leave it as it is now.

@gareth-nx
Copy link
Contributor Author

No worries. I'll wait a while in case there are other suggestions. But likely this can be merged as is.

@gareth-nx gareth-nx merged commit f53ad6b into fortran-lang:master Apr 4, 2024
17 checks passed
@gareth-nx gareth-nx deleted the examples_with_implicit_none branch April 4, 2024 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants