New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doxygen 'forgets' #define documentation under certain conditions (Origin: bugzilla #614443) #3720

Closed
doxygen opened this Issue Jul 2, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@doxygen
Owner

doxygen commented Jul 2, 2018

status RESOLVED severity normal in component general for ---
Reported in version 1.6.3 on platform Other
Assigned to: Dimitri van Heesch

On 2010-03-31 10:00:17 +0000, Hubert Mackenberg wrote:

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'

On 2010-03-31 19:52:02 +0000, Dimitri van Heesch wrote:

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.

On 2010-06-15 11:22:01 +0000, Dimitri van Heesch wrote:

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.

@doxygen doxygen closed this Jul 2, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment