This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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]

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.)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]