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

Check intent of automatic sized character arrays #21

Closed
christophermaynard opened this issue Jun 23, 2020 · 0 comments
Closed

Check intent of automatic sized character arrays #21

christophermaynard opened this issue Jun 23, 2020 · 0 comments
Labels
enhancement New feature or request new rule Add a new rule

Comments

@christophermaynard
Copy link

christophermaynard commented Jun 23, 2020

Automatic sized arrays for characters can be used in Fortran, especially for subroutine arguments.

subroutine file_reader(filename)
  implicit none
character(*), intent(in) :: filename`

If they are intent(in) then there is no danger of scribbling over some other memory by writing back to the character array with data bigger than the array. intent(out) makes little sense and is hopefully not allowed by compilers. intent(inout) is potentially dangerous, In summary, intent(in) only is allowed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request new rule Add a new rule
Projects
None yet
Development

No branches or pull requests

2 participants