ford icon indicating copy to clipboard operation
ford copied to clipboard

Procedures within procedures are ignored

Open dschwoerer opened this issue 4 years ago • 5 comments
trafficstars

The following is valid fortran (gfortran doesn't complain) but ford does not include test2 in the documentation.

      function test1()
      contains
      subroutine test2()
      end subroutine test2
      end function test1

This leads to cases like #364 where some function are not included in the call graph.

dschwoerer avatar Sep 29 '21 14:09 dschwoerer

There's an argument that internal procedures are an implementation detail and so perhaps shouldn't be included in the documentation. So this is somewhere between a bug and a feature request. Maybe they should be included with private entities?

ZedThree avatar Sep 29 '21 14:09 ZedThree

I think that is causing more issues, than it is solving, as it e.g. breaks call graphs.

The only option would be to sort of inline the function in the other function, otherwise the documentation is missing calls.

Expanded example:

      function test1()
      call test2
      contains
      subroutine test2()
      call test3
      end subroutine test2
      end function test1


      subroutine test3()
      end subroutine test3

I would expect test1->test2->test3 which is what you get if test2 is its own function, but so you get test1 and test3 (i.e. not connected) - but it should be at least test1->test3 which I think is more difficult to implement than test1->test2->test3.

dschwoerer avatar Sep 29 '21 15:09 dschwoerer

As a side node, such procedures are included in doxygen.

dschwoerer avatar Sep 29 '21 15:09 dschwoerer

Ok, that is definitely convincing! Breaking the call graph (in the mathematical sense, rather than the image sense) isn't good.

ZedThree avatar Sep 29 '21 17:09 ZedThree

I think this is already solved by setting proc_internals: true?

ZedThree avatar Feb 21 '22 10:02 ZedThree