10

With doxygen, I'm used to write

/**
 * @brief blah blah
 *
 * @param foo description of foo
 * @param bar description of bar
 * @return description of the return value
 */
int f(int foo, unsigned bar);

But what if I don't name one of the parameter? :

int f(int, unsigned bar);

How can I document this parameter when I can't refer to it by name?

11
  • Other than make a textual reference it is, as far as I know, not possible. What is the objection of having a name in the definition / prototype? Commented Mar 29, 2019 at 16:56
  • 1
    @albert: When you do not use the parameter, it is (sort of) customary to leave it nameless. Commented Mar 29, 2019 at 16:58
  • Yes I know, but why having the argument in the first place (historical / compatibility is a good reason though). What is the reason for documenting the not used argument? Commented Mar 29, 2019 at 17:03
  • 1
    @albert: It might be important to understand why this function is invoked with an extra supposedly-useless parameter, e.g. (in other functions invoked similarly this is used for XYZ, but in this function it isn't because reasons." Commented Mar 29, 2019 at 17:17
  • I think in that case here it should be also 'XYZ' (or 'dummy_xyz') and the description should explain why it is present. Commented Mar 29, 2019 at 17:33

1 Answer 1

3

Doxygen does not currently (July 2020) implement this functionality. However, a feature request has been opened on the Doxygen GitHub issues page for it:

#6926 Feature request: doc for unnamed parameters

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

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.