This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Fortran,patch] PR 39178 - inline main()
- From: Tobias Burnus <burnus at net-b dot de>
- To: Dave Korn <dave dot korn dot cygwin at googlemail dot com>
- Cc: gcc-patches at gcc dot gnu dot org, fortran at gcc dot gnu dot org
- Date: Wed, 27 May 2009 14:21:09 +0200
- Subject: 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