23

I have a rather odd problem with Doxygen (1.6.1 on Mac OS X Snow Leopard) in that it does not seem to document my enums no matter what I do. I am programming in C and have followed the instructions in the manual. Here is my code:

/**
 * \enum dccp_pkt_type 
 * \brief specifies the available DCCP packet types
 */

enum dccp_pkt_type
{
    DCCP_REQUEST    = 0,    /**< DCCP Request Packet */
    DCCP_RESPONSE,          /**< DCCP Response Packet */
    DCCP_DATA,              /**< DCCP Data Packet */
    DCCP_ACK,               /**< DCCP Ack Packet */
    DCCP_DATAACK,           /**< DCCP Data Ack Packet */
    DCCP_CLOSEREQ,          /**< DCCP Close Request Packet */
    DCCP_CLOSE,             /**< DCCP Close Packet */
    DCCP_RESET,             /**< DCCP Reset Packet */
    DCCP_SYNC,              /**< DCCP Sync Packet */
    DCCP_SYNCACK,           /**< DCCP Sync Ack Packet */
    DCCP_RESERVED,          /**< DCCP Reserved Packet Type - Receivers MUST
                         ignore any packets with this type */
};

It should according to the doxygen manual produce properly documentated output but instead it produces nothing. I am most likely missing something simple, if anyone could point me in the right direction I would be grateful.

1
  • 2
    General comment not addressing the question: Your [Doxygen] comments for individual enum values (perhaps with the exception of the "ignore" note for DCCP_RESERVED) do not add anything useful, just clutter the view. Commented Oct 20, 2017 at 7:17

3 Answers 3

36

From the Doxygen manual:

Let’s repeat that, because it is often overlooked: to document global objects (functions, typedefs, enum, macros, etc), you must document the file in which they are defined. In other words, there must at least be a

/*! \file */ or a

/** @file */ line in this file.

Sign up to request clarification or add additional context in comments.

Comments

11

My experience is the same using EXTRACT_ALL=NO and SHOW_INCLUDE_FILES=NO with doxygen 1.8.9.1 - global enum types were not listed nor linked even though /*! \file */ is present and the global enum is referenced by a documented compound structure.

To work around this, I ended up defining an Enumerations group:

/*! \defgroup Enumerations Public enumeration types */

and for the enum types I used \ingroup Enumerations to include the enums in the new group. Doxygen then was able to autolink from the compound structures to the enum types.

1 Comment

I'm finding this too in version 1.8.11.
4

If memory serves correctly, enum documentation doesn't show up unless the file is also documented. Try adding a @file section.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.