This is the mail archive of the
mailing list for the GCC 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: Dave Korn <dave dot korn dot cygwin at googlemail dot com>
- To: Dave Korn <dave dot korn dot cygwin at googlemail dot com>
- Cc: Tobias Burnus <burnus at net-b dot de>, Angelo Graziosi <angelo dot graziosi at alice dot it>, Fortran <fortran at gcc dot gnu dot org>, "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Sat, 30 May 2009 19:38:10 +0100
- 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.email@example.com> <4A214191.firstname.lastname@example.org> <4A2143EA.email@example.com> <4A214B46.firstname.lastname@example.org> <4A216AA3.email@example.com> <4A2173B7.firstname.lastname@example.org> <4A217895.email@example.com>
Dave Korn wrote:
> Tobias Burnus wrote:
>> I agree that for "main" the call to "__main()" should happend and thus
>> expand_main_function should be called. I'm not sure in about the exact
>> assumptions of the middle end. In principle, it would be OK if the
>> MAIN__ function would show up as MAIN__ in gimple/-fdump-tree-original.
>> The only potential inconvenience I see, is the mentioned reference to
>> MAIN__ instead of <program name> in middle-end warnings, which can
>> confuse users.
> Wouldn't the simplest thing be to rename the other main function - the
> initialisation one that is automatically generated by create_main_function()?
> It could be called anything different we liked, and it's not user-visible, so
> it ought to not be a problem to rename?
Argh, no. Cygwin crt0 for one expects the entrypoint function to be called
_main in any language. Hmmm.