Fortran question

Toon Moene toon@moene.indiv.nluug.nl
Thu Aug 5 14:46:00 GMT 2004


Lassi A.Tuura wrote:

 > Dale Johannesen wrote:

>> With IMA, I've discovered that one of the Fortran SPEC benchmarks (fma3d)
>> has a named common block that is different sizes in different source 
>> files, in
>> violation of both the f77 and f90 standards.  However, the fact that 
>> this program
>> normally works, presumably in a lot of different environments, when it 
>> would
>> be easy to detect the error at linktime, suggests that maybe it is 
>> used a fair
>> amount in existing code, and maybe it would be a good idea for the 
>> compiler
>> to accept it.  What do the Fortran experts think?  Thanks.
> 
> I'm not a FORTRAN programmer, but I can tell what the millions of lines 
> we have here expect :-) The linker should pick the largest size for the 
> common.

This is indeed the way it is normally treated.  g77 will complain if 
verious compilation units in one source file declare different lengths 
of named common.  I haven't checked what gfortran does.

Cheers,

-- 
Toon Moene - mailto:toon@moene.indiv.nluug.nl - phoneto: +31 346 214290
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
Maintainer, GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html
A maintainer of GNU Fortran 95: http://gcc.gnu.org/fortran/



More information about the Gcc mailing list