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

Fortran Standard violation in dbcsr_api_c.F #536

Open
SpinTensor opened this issue Jan 10, 2022 · 0 comments
Open

Fortran Standard violation in dbcsr_api_c.F #536

SpinTensor opened this issue Jan 10, 2022 · 0 comments

Comments

@SpinTensor
Copy link

SpinTensor commented Jan 10, 2022

In the File dbcsr_api_c.F in the subroutine c_free_string the intrinsic subroutine c_f_pointer is called: CALL c_f_pointer(c_string, string). The second argument is declared as CHARACTER(:, kind=c_char), POINTER :: string. The Fortran standard draft ISO/IEC FDIS 1539-1:2018 section 18.2.3.3 states that the second argument of the c_f_pointer "[...]shall not have the deferred type parameter[...]", which is has in this routine.

Edit: The standard gives (in Case iv) an example of how to deal with pointers with deferred type parameters and how to handle them. I will cite it here so there is no need to look it up:

Character(42), Pointer :: C1
Character(:), Pointer :: C2
Call C_F_Pointer(CPTR, C1)
C2 => C1
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

No branches or pull requests

1 participant