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: Tobias Burnus <burnus at net-b dot de>
- To: Dave Korn <dave dot korn dot cygwin at googlemail dot com>
- Cc: 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 20:45:11 +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.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> <4A217D12.firstname.lastname@example.org>
Dave Korn wrote:
>> 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.
In terms of -fdump-tree-original (all(?) other dumps place the assembler
name in parentheses) and for the special handling of "main" in the
middle end, having MAIN__ everywhere would be useful. Except for the
test.f90: In function 'helloworld':
test.f90:3: warning: 'i' is used uninitialized in this function
is better readable for the user than a
test.f90: In function 'MAIN__':
test.f90:2: warning: 'i' is used uninitialized in this function
Frankly, I don't have any idea how to solve the problem while retaining
the proper names in the middle-end diagnostics. But of cause on can
decide that the diagnostic output is less of a problem and live with
"MAIN__" in the middle-end diagnostics. (The front-end diagnostic
message are not effected.)