After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 566128 - Wrong picture of recursive function
Wrong picture of recursive function
Status: RESOLVED OBSOLETE
Product: doxygen
Classification: Other
Component: general
1.5.8
Other Windows
: Normal normal
: ---
Assigned To: Dimitri van Heesch
Dimitri van Heesch
[moved_to_github]
Depends on:
Blocks:
 
 
Reported: 2008-12-31 12:58 UTC by albert
Modified: 2018-07-30 10:24 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Project with source files and resulting doxygen output (190.00 KB, application/x-tar)
2008-12-31 13:03 UTC, albert
Details
Call graph does not show recursive functions (175.27 KB, application/zip)
2014-06-14 16:49 UTC, Cornelius
Details

Description albert 2008-12-31 12:58:26 UTC
When having a recursive function, the function is depicted wrong in the call graph in the .h file and in the caller graph with the .c file.
(This function might be related to bug 527049 which deals with a non recusive function but defined in .h file as well).

Example code:
bug_r.h:
int bug_r(int val);

bug_r.c:
#include "bug_r.h"

int bug_r(int val)
{
  if (val <= 1) return 1;
  return(val * bug_r(val -1));
}
Comment 1 albert 2008-12-31 13:03:02 UTC
Created attachment 125574 [details]
Project with source files and resulting doxygen output
Comment 2 albert 2010-11-08 21:39:32 UTC
In case of Fortran no graph is displayed at all.

Example code:
recursive integer function rec_fie(i)
  integer i
  if (i == 0) then
    rec_fie = 0
  else
    rec_fie = i + rec_fie(i-1)
  endif
end

recursive subroutine rec_sub(i, res)
  integer i
  integer res

  if (i == 0) then
    res = 0
  else
    call rec_sub(i-1, res)
    res = res + i
  endif
end
Comment 3 Cornelius 2014-06-14 16:46:26 UTC
Bug is still open in DoxyGen Version 1.8.7. 
Here is one additional example.

-----------------
void tic() 
{
    tac();
}
void tac() 
{
    toc();
}
void toc() 
{
    tic();
}

int fact(int n)
{    
    int x=1;    

    while(n>1)    
    {    
        x=n*fact(n-1);  //recursive function in C 
    }    

    return(x);    
}    

void main() 
{
 	fact(5);
	tic();

}
Comment 4 Cornelius 2014-06-14 16:49:51 UTC
Created attachment 278448 [details]
Call graph does not show recursive functions

Call graph does not show recursive functions
Comment 5 André Klapper 2018-07-30 10:24:52 UTC
As discussed in https://github.com/doxygen/doxygen/pull/734 , Doxygen has moved its issue tracking to 

   https://github.com/doxygen/doxygen/issues

All Doxygen tickets in GNOME Bugzilla have been migrated to Github. You can subscribe and participate in the new ticket in Github. You can find the corresponding Github ticket by searching for its Bugzilla ID (number) in Github.

Hence I am closing this GNOME Bugzilla ticket.
Please use the corresponding ticket in Github instead. Thanks a lot!