Clicky

Fortran Wiki
Question

I use the jsu_readline, probably from ‘urbanjost’, found many years ago somewhere in the internet. It works fine for a long time, still with some warnings compiling the subroutine FCreadline.c. Since debian 13 gfortran (gcc version 14.2.0) it rejects this subroutine as erroneous.

I found this subroutine in the Fortran Wiki as iso_readline(3f). Compiling it results in the same error (the comment marker in the 6th line of this example should read read / instead of / ?):

fcreadline.c:24:1: error: return type defaults to ‘int’ [-Wimplicit-int] 24 | FCreadline(int len, charmyline, char prompt[]){ | ^~~~~~~~~~ My work around: using the object file FCreadline.o from debian12, which is not as it should work.

Is there a corrected ersion available? Thanks in advance.

The message is indicating the return value needs explicitly declared, or in this case, needs set to void. Place the word “void” in front of FCreadline. I am not at a place were I can verify that is all that is needed, but I will change the entry found here on the Fortran wiki accordingly. https://github.com/urbanjost/general-purpose-fortran contains the latest version of this and a few thousand other routines as well.