1

This method to document the fields of a struct does not work for me:

typedef struct wigrec {

    /** next entry in list */ wigptr next;
...

However this does:

typedef struct wigrec {

    /// next entry in list
    wigptr next;
...

I prefer the first form, because it keeps it all on one line. I use /** opening comment several other places in my program with no issue, its just in a struct that it does not work. According to the online manual it should work:

https://www.doxygen.nl/manual/docblocks.html

What am I missing here?

Information on doxygen:

samiam@samiam-h-pc-2:~/projects/petit_ami$ doxygen -v
1.8.17
samiam@samiam-h-pc-2:~/projects/petit_ami$ doxygen -x petit_ami.dox

# Difference with default Doxyfile 1.8.17
PROJECT_NAME           = test
PROJECT_BRIEF          = "Test of doxygen"
OUTPUT_DIRECTORY       = test_html
ABBREVIATE_BRIEF       =
OPTIMIZE_OUTPUT_FOR_C  = YES
LOOKUP_CACHE_SIZE      = 1
EXTRACT_ALL            = YES
EXTRACT_STATIC         = YES
CASE_SENSE_NAMES       = NO
INPUT                  = test.c
FILE_PATTERNS          =
EXCLUDE                = glibc
EXAMPLE_PATTERNS       =
USE_MDFILE_AS_MAINPAGE = doxmain.txt
SOURCE_BROWSER         = YES
HTML_TIMESTAMP         = YES
GENERATE_TREEVIEW      = YES
MATHJAX_RELPATH        = http://cdn.mathjax.org/mathjax/latest
GENERATE_LATEX         = NO
LATEX_CMD_NAME         = latex
CALL_GRAPH             = YES
CALLER_GRAPH           = YES

Program:

struct {

    /** this is a test field */ int a;
    int b;
    int c;

} mystruct;


int main()

{

}

enter image description here

Alternate program:

struct {

    /// this is a test field
    int a;
    int b;
    int c;

} mystruct;


int main()

{

}

And that result:

enter image description here

For program:

/** This is a test structure */
struct {

    /// this is a test field
    int a;
    int b;
    int c;

} mystruct;


int main()

{

}

Doxygen does give the struct a comment, but it is below:

enter image description here

enter image description here

I notice it also puts the comment for my /** this is a test field / int a; but I would like it to document that in structure display, like /// does. I don't understand why these are not equivalent, which the doxygen manual implies that it is, that is /* and /// are equivalent doxygen prefix comments.

Thanks for the feedback.

Scott Franco
  • 481
  • 2
  • 15
  • you can refer [here](https://stackoverflow.com/questions/7199151/use-doxygen-to-document-members-of-a-c-structure-outside-of-the-structure-defini). – gretal May 10 '22 at 05:24
  • Which version of doxygen (i.e. (`doxygen -v`)? What are your settings different from the default settings (i.e. the output of `doxygen -x`)? Can you give a small complete example in your question including what you see as result. What happens when you document the typedef itself or set `EXTRACT_ALL=YES`. – albert May 10 '22 at 07:48
  • Thanks, put the information in the question above. – Scott Franco May 11 '22 at 07:40
  • Note the current doxygen version is 1.9.4. The problem here is about the brief description. You have to set `JAVADOC_AUTOBRIEF=YES` or use `\brief`. – albert May 11 '22 at 07:48
  • Thanks albert, that did it. If you would like credit for the answer, please write that up as an answer. – Scott Franco May 12 '22 at 05:04

0 Answers0