ford
ford copied to clipboard
Procedures within procedures are ignored
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.
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?
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.
As a side node, such procedures are included in doxygen.
Ok, that is definitely convincing! Breaking the call graph (in the mathematical sense, rather than the image sense) isn't good.
I think this is already solved by setting proc_internals: true?