Liste des Groupes | Revenir à cl fortran |
On 1/14/2025 12:42 PM, Thomas Koenig wrote:Lynn McGuire <lynnmcguire5@gmail.com> schrieb:>
I found and fixed the problem with my code along with one of my
programmers. I was not properly handling the size_t hidden argument
length value that GFortran adds to the character string arguments in my
C++ code. Things are going better now.
Good to hear that.
Another thing that works well for gcc is to link everything with
the -flto option.
An example:
$ cat main.f90
program memain
character *1 c
call foo(c)
print *,c
end
$ cat foo.c
void foo_(char *c)
{
*c = 'A';
}
$ gfortran -flto main.f90 foo.c
main.f90:3:13: warning: type of 'foo' does not match original declaration [-Wlto-type-mismatch]
3 | call foo(c)
| ^
foo.c:1:6: note: type mismatch in parameter 2
1 | void foo_(char *c)
| ^
foo.c:1:6: note: type 'void' should match type 'long int'
foo.c:1:6: note: 'foo_' was previously declared here
I will try it.
Les messages affichés proviennent d'usenet.