This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Fortran,patch] PR 39178 - inline main()


Hi Dave,

> $ cat /tmp/libgfortranbegin/libgfortranbegin.s
> 
>         .section gnu.warning.main, "rd"
>         .ascii  "libgfortranbegin is deprecated.  Please remove"
>         .asciz "it from your linker command-line."

Seems to be reasonable. I then would suggest to deprecate it
with such a warning in 4.5 and remove it in 4.5.

The question is whether one wants to still keep the
rest of libgfortran/fmain.c (to allow older programs to link,
where the main program has not been compiled with gfortran 4.5)
or whether one removes it completely.

How about creating a proper patch?

> ... and even that's overkill just because I don't know
> how many underscores to use for fortran!

None in this case. The Fortran main program is in the
function "MAIN__" due to historic reasons (this is the
case in several Fortran compilers).

However, libgfortranbegin contains the normal "main()" as
known from C, which does some initializations and then
calls MAIN__. See libgfortran/fmain.c for how little is
done in libgfortranbegin.a.

Tobias


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]