Home > Archive > Fortran > June 2004 > Re: Subroutine Argument Checking
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Re: Subroutine Argument Checking
|
|
| Toon Moene 2004-06-10, 3:58 pm |
| Richard Maine wrote:
> Nyarlathotep <cthulhu@cthulhu.org> writes:
>
> Of course, then your code won't compile very well with g77. :-(
> Look forward to g95 and/or gfortran.
I wouldn't count on it :-) One of the discerning features of GCC
releases to come is that it will do "whole program" analysis when
requested and given enough source to work on.
g77 complains about this misuse of the "separate compilation" idiom of
Fortran because it knows havoc will ensue if it allows this code to pass.
It will only be more pressing to drop this hot iron once the compiler
*has to* generate code for subroutines or functions that have
conflicting definition and use.
Consider the following:
CALL SUB(A)
END
SUBROUTINE SUB(I)
END
Why does g77 warn about this ? Because, if it were requested to inline
SUB into the main program, the backend would XXXXX about conflicting
type information (should it generate integer instructions when dealing
with I in SUB, or floating point instructions - as demanded by the main
program ?
Obviously, g95 or gfortran isn't going to "solve" this problem. The
problem is between keyboard and chair.
--
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)
| |
| Richard Maine 2004-06-10, 3:58 pm |
| Toon Moene <toon@moene.indiv.nluug.nl> writes:
> Richard Maine wrote:
>
>
> I wouldn't count on it :-)...
I think you missed some of the context.
Or perhaps it is more politic to say that I explained it poorly. :-)
In short...
The poster wanted diagnosis of mismatched arguments (which some f77
compilers give now in some cases, but others don't). I suggested
that he could use module procedures, but that this wouldn't work under
g77. The comment about looking forward to g95/gfortran was so that
he could use module procedures.
I certainly expect gfortran to solve the problem of not having a
gnu compiler that will compile f90 modules.
--
Richard Maine | Good judgment comes from experience;
email: my first.last at org.domain | experience comes from bad judgment.
org: nasa, domain: gov | -- Mark Twain
|
|
|
|
|