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

refactor(mf6bmiutil): simplify string_to_char_array #1987

Closed

Conversation

wpbonelli
Copy link
Contributor

@wpbonelli wpbonelli commented Aug 9, 2024

I think this function can be simplified. The Fortran wiki claims the older version is still necessary, but the relevant section was added 14 years ago, and more recently the consensus on the fortran-lang forum is that passing trim(str) // c_null_char suffices, corroborated in a J3 proposal.

Still need to work out some issues

This function is evidently no longer necessary. The Fortran wiki claims it is (https://fortranwiki.org/fortran/show/Generating+C+Interfaces#strings), but the relevant section was added 14 years ago (https://fortranwiki.org/fortran/revision/diff/Generating+C+Interfaces/9), and more recently the consensus on the fortran-lang forum is that passing 'trim(str) // c_null_char' suffices (https://fortran-lang.discourse.group/t/best-practices-for-passing-c-strings)
@wpbonelli wpbonelli changed the title string to char array refactor(mf6bmiutil): remove string_to_char_array function Aug 9, 2024
…arning... is there a better way around this?
@wpbonelli wpbonelli changed the title refactor(mf6bmiutil): remove string_to_char_array function refactor(mf6bmiutil): simplify/remove string_to_char_array Aug 9, 2024
@wpbonelli wpbonelli changed the title refactor(mf6bmiutil): simplify/remove string_to_char_array refactor(mf6bmiutil): simplify string_to_char_array Aug 9, 2024
@wpbonelli wpbonelli marked this pull request as draft August 9, 2024 19:44
@wpbonelli wpbonelli added the code refactor Nonfunctional changes label Aug 14, 2024
@wpbonelli
Copy link
Contributor Author

closing, different solution forthcoming momentarily

@wpbonelli wpbonelli closed this Aug 15, 2024
@wpbonelli wpbonelli deleted the string-to-char-array branch August 15, 2024 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code refactor Nonfunctional changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant