This is the mail archive of the
gcc@gcc.gnu.org
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.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>
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
warnings; having
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.)
Tobias