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 614465 - \relates confused on multiple static functions with the same name.
\relates confused on multiple static functions with the same name.
Status: RESOLVED OBSOLETE
Product: doxygen
Classification: Other
Component: build
1.6.3
Other Windows
: Normal normal
: ---
Assigned To: Dimitri van Heesch
Dimitri van Heesch
[moved_to_github]
Depends on:
Blocks:
 
 
Reported: 2010-03-31 13:47 UTC by squ175
Modified: 2018-07-30 10:46 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description squ175 2010-03-31 13:47:14 UTC
If you have static functions in different cpp files for different classes that have the same name and you try to \relates them to their respective classes, they all get lumped together on a single class.  I would expect that the function to appear with the class they \relates to.

The following example illustrates the problem:


doxy_errA.cpp --------
class ClassA{}; // normally included from a header

//! \relates ClassA
static void Function()
{
}


doxy_errB.cpp --------
class ClassB{}; // normally from a header

//! \relates ClassB
static void Function()
{
}



If doxy_errA.cpp and doxy_errB.cpp are included via the doxy wizard in the following order:

doxy_errA.cpp
doxy_errB.cpp

The documentation for Function() all ends up associated with ClassA.  If you reverse the order of the files so that doxy_errB.cpp is first, the association switches to ClassB

The doxy docs generated are as follows (pasted HTML converted to text):

---------------------------------

ClassA Class Reference

List of all members.
Related Functions

(Note that these are not member functions.)


static void 	Function ()
Detailed Description

Definition at line 2 of file doxy_errA.cpp.
Friends And Related Function Documentation
static void Function 	( 		 )  	[related]

Definition at line 5 of file doxy_errA.cpp.

00006 {
00007 }

The documentation for this class was generated from the following files:

    * T:/doxy_errA.cpp
    * T:/doxy_errB.cpp

---------------------------------



My style is to use static non-member functions for small helper functions instead of static private members whenever possible.  This limits pollution of the class definition with private details.  Given the tight coupling to the class, I \relates them to the class.

I tend to name these functions similarly if they do similar jobs.  Particularly in the case of a number of classes derived from the same base, it is likely that these static helpers end up with the same name and signature.  

Since this style is pervasive in our code base, I am seeing this bug a lot as we start to Doxify our code.  

I have not looked carefully enough to see if this problem also occurs when the signature is different.
Comment 1 André Klapper 2018-07-30 10:46:34 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!