Skip to content

Fixes a C-Fortran interface

Nicolas Tancogne-Dejean requested to merge fix_interface into main

Description

Fixes a C-Fortran interface. This was causing GCC 13 to lead systematically to an invalid memory reference.

We had a wrong Fortran-C interface were we specified "intent(out)" when the see code was clearly expecting "intent(inout)" on the C part.

Why it appears in GCC 13 is in fact very simple. The Changelog for GCC 13 states for Fortran:

Finalization is now fully supported. 

In case of "intent(out)", I know by experience that the finalizer of the object is called by GCC. In this case, a pointer was then properly nullified. Then, we were getting an invalid memory reference.

Checklist

  • I have checked that my code follows the Octopus coding standards
  • I have added tests for all the new features added in this request.
Edited by Nicolas Tancogne-Dejean

Merge request reports