g77 help

Toon Moene toon@moene.indiv.nluug.nl
Sat Nov 15 15:20:00 GMT 2003


Fernass Daoud wrote:

> We use for our array management a common block named L. So we define in 
> the subroutines the common block as usual
>    COMMON L(1)
> But the compiler gives this warning message, for example in combination 
> with EQUIVALENCE:     Warning: Array subscript #1 out of range for 
> EQUIVALENCE of `l'
> in the case of
>    EQUIVALENCE (L(4),IDIR),(L(3),NEXT),(L(15),IVM),(L(74),MAXUSE)
> 
> How to get rid of this?

Unfortunately, you can't.  g77 doesn't offer a flag to "hide" this 
misuse of array extents.

The only solution is to change (in each subroutine, if it's not provided 
with an include):

       COMMON L(1)

with

       COMMON L(MAX)

where MAX > the largest index you need.

Hope this helps,

-- 
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
GNU Fortran 95: http://gcc.gnu.org/fortran/ (under construction)



More information about the Gcc-help mailing list