This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [fortran] Different FUNC_DECLS with the same DECL_NAME - MAIN__ and named PROGRAM main functions [was Re: gcc-4.5-20090528 is now available]
- From: Tobias Burnus <burnus at net-b dot de>
- To: Dave Korn <dave dot korn dot cygwin at googlemail dot com>
- Cc: Jerry DeLisle <jvdelisle at verizon dot net>, Fortran <fortran at gcc dot gnu dot org>, "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Mon, 08 Jun 2009 19:39:34 +0200
- Subject: Re: [fortran] Different FUNC_DECLS with the same DECL_NAME - MAIN__ and named PROGRAM main functions [was Re: gcc-4.5-20090528 is now available]
- References: <4A20F778.9010705@alice.it> <4A214191.1050206@gmail.com> <4A2143EA.2050904@gmail.com> <4A214B46.7040405@gmail.com> <4A216AA3.1070000@gmail.com> <4A2173B7.6040206@net-b.de> <4A217895.9060708@gmail.com> <4A217D12.9000801@gmail.com> <4A2180C2.2010500@gmail.com> <4A2183EF.20004@net-b.de> <4A232A6A.60304@verizon.net> <4A2D3688.5060606@gmail.com>
Dave Korn wrote:
>>> + main_identifier_node = get_identifier ("main");
>>> + ftn_main = build_decl (FUNCTION_DECL, main_identifier_node, tmp);
>>> ftn_main = build_decl (FUNCTION_DECL, get_identifier ("main"), tmp);
>>>
> I just took a second look at this. We surely didn't mean to build two decls
> and throw one away, did we?
Why have I always read
- ftn_main = build_decl (FUNCTION_DECL, get_identifier ("main"), tmp);
although there was no "-"?
> I think the second assignment to ftn_main was supposed to have been
> deleted when the middle argument was changed. Ok if so?
Yes, of cause it should have been deleted. OK for the trunk and thanks
for spotting it!
Tobias
> gcc/fortran/ChangeLog
>
> * trans-decl.c (create_main_function): Don't build main decl twice.