• Re: how do you send a fortran character string from GCC to GFortran ?

    From Lynn McGuire@lynnmcguire5@gmail.com to comp.lang.fortran on Tue Sep 23 22:07:54 2025
    From Newsgroup: comp.lang.fortran

    On 1/2/2025 4:06 AM, Thomas Koenig wrote:
    Lynn McGuire <lynnmcguire5@gmail.com> schrieb:
    How do you send a fortran character string from GCC to GFortran ?

    I cannot get this to link. I can do the reverse, send a fortran
    character string from Gfortran to GCC.

    A full, self-contained example would be helpful for somebody trying to
    help (especially since you say "link", which seems weird).

    But take a look at

    https://gcc.gnu.org/onlinedocs/gfortran/Naming-and-argument-passing-conventions.html

    I do have the additional complication that I do not know the length of
    the fortran character string being sent from GCC to Gfortran at compile
    time, only run time. So that is a character*(*) string.

    I am not using the ISO C binding.

    It is generally a good idea to use ISO C binding in new code, it
    is what it was introduced for.

    But you might also find

    https://gcc.gnu.org/onlinedocs/gfortran/Interoperability-Options.html

    of interest.

    BTW, I separate my compilation and linking phases. I have 5,000+ F77 subroutines in 3,000 files and a 1,000+ C++ functions in 200+ files. So building is a big deal for me and I separate the steps to minimize the
    error finding. Around 900,000 lines of code now.

    Lynn

    --- Synchronet 3.21a-Linux NewsLink 1.2