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 614443 - Doxygen 'forgets' #define documentation under certain conditions
Doxygen 'forgets' #define documentation under certain conditions
Status: RESOLVED FIXED
Product: doxygen
Classification: Other
Component: general
1.6.3
Other Windows
: Normal normal
: ---
Assigned To: Dimitri van Heesch
Dimitri van Heesch
Depends on:
Blocks:
 
 
Reported: 2010-03-31 10:00 UTC by Hubert Mackenberg
Modified: 2010-06-15 11:22 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Hubert Mackenberg 2010-03-31 10:00:17 UTC
Doxygen 'forgets' the documentation of defines under certain conditions.

Example:

1. Create a file test.h with this content:

        /// @defgroup Test
        /// @{

        /// macro BAR
        #ifndef BAR
           #define BAR  someFunction(x)
        #endif

        /// macro Foo
        #define FOO 42

        /// @}

        /// @page page1 
        /// Use @ref FOO

2. Create an default configuration file using:

      doxygen -g

3.  In Doxfile, set:

     INPUT = test.h

4. Run doxygen:

     doxygen

Doxygen complains:

  D:/test.h:17: Warning: unable to resolve reference to `FOO' for \ref command

In the generated documentation the both macro BAR and FOO are missing.

Note:
 - the problem does not occur for doxygen version 1.6.2.
 - the problem also occurs in the SVN version 1.6.3-20100324.
 - the problem disappears if the BAR macro gets slightly modified
   (remove the #ifdef, replace #ifndef BAR by #ifndef BAR2 or just
    change the macro definition to '#define BAR 123'
Comment 1 Dimitri van Heesch 2010-03-31 19:52:02 UTC
The main problem is that the header file does not have an include guard and the more relaxed heuristics added to doxygen recently now see the BAR construct as an include guard, hence ignoring it.

This was changed to support include guards of the form
#ifndef BLA_H
#define BLA_H 1
...
#endif
used by some people.

I'll make the heuristics a bit more strict so that your case will not been seen as an include guard anymore, but I suggest to always add include guards to your header files.
Comment 2 Dimitri van Heesch 2010-06-15 11:22:01 UTC
This bug was previously marked ASSIGNED, which means it should be fixed in
doxygen version 1.7.0. Please verify if this is indeed the case. Reopen the
bug if you think it is not fixed and please include any additional information
that you think can be relevant.