This is the mail archive of the gcc@gcc.gnu.org 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]

Re: option -warn-common for Fortran?


>wouldn't it make sense to leave out -warn-common from the linker options
>on Linux (collect2), if we link with g77?
>
>These 'errors' are quite useful in Fortran 77.
>(Common blocks have to be defined in every subroutine, where they are used.
>So you have them muliply defined in every source file.)
>
>(i get a lot of output linking my progs here...)

Anything you want to share with us, by way of a small example?  AFAIK,
g77 doesn't output a *definition* for a common block unless it is asked
to *initialize* it with at least one value (via DATA, for example).

If you're initializing a given common block in more than one program unit,
you're violating the FORTRAN 77 standard.  (In fact, you're doing that
if you initialize it in anything other than a BLOCK DATA program unit,
but g77 relaxes that particular rule.)

But if you can show an example where simply *declaring* (in C terms)
a common block in multiple program units (perhaps in different source
files) leads to warnings, then, yes, I'd say those warnings represent
bugs, and it'd be nice to find out why they (presumably) don't happen
when equivalent C code (such as output by f2c) is compiled and linked.

        tq vm, (burley)


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