Re: Huge program, no interfaces, ugh



On Jan 31, 12:01 pm, "Ancient_Hacker" <g...@xxxxxxxxxxx> wrote:
HI, I have this relatively huge program, about 40,000 lines in 183
source files.

I've found lots of errors in the source code caused by arguments that
don't match the subroutine dummy argument type.

But the compiler doesnt find many of these by itself, as none of the
subroutines had interfaces (to start out with). I'm building up
interfaces as I go along, but the task is error-prone-- if I forget to
add "use glue" to a subroutine, it will silently compile anyway and
generate bad calls.

It sure would be nice if the compiler required interfaces for every
called function or subroutine.

You could put all the code for functions and subroutines in a module
foo
and insert "use foo" in the main program -- doing so provides an
explicit
interface.

It looks like you are working with a FORTRAN 77 code -- the free
program
FTNCHEK is invaluable for checking interfaces.

.



Relevant Pages

  • Re: DPROD issues
    ... a switch like that typically ... makes a compiler nonstandard in that mode. ... treatment of specific intrinsics is one ... subroutine sub1a ...
    (comp.lang.fortran)
  • Re: Jumping into block of an if construct
    ... (For that matter a clever enough compiler could replace this PUT DATA ... routine which itself executes the loops around element handling. ... Either way I think the cost of element handling will usually ... So locally based on subroutine arguments, but not on, for example, ...
    (comp.lang.fortran)
  • Re: Bus error/ segmentation fault--help?
    ... When I compile with the intel fortran compiler, ... This subroutine integrates the function y3 up one step, ... implicit double precision (a-h, o-z) ...
    (comp.lang.fortran)
  • Re: Question about name conflicts in Fortran
    ... I am hacking the g95 compiler so that it dumps the structure ... Subroutine foo ... The para after the 2nd numbered list in 16.2 covers the case where the ... One of the exceptions is "a generic name may be the ...
    (comp.lang.fortran)
  • Re: using dot_product from c++
    ... I tried to write a very simple subroutine where two vector are dot ... Assumed shape arrays are incompatible with mixed language use unless you code explicitly for the descriptor on the other side, which will be highly nonportable (even from one version of a compiler to another, let alone from one compiler to another). ... You should either not initialize the vectors or you should not use push_back but instead reference the location you wish to access directly. ... I guess maybe it arises because the misunderstandings between the codes multiply to put the memory manager out of whack. ...
    (comp.lang.fortran)