Skip to content

Reduce Doxygen warnings #3170

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

Merged
merged 5 commits into from
Oct 15, 2018
Merged

Reduce Doxygen warnings #3170

merged 5 commits into from
Oct 15, 2018

Conversation

johnnonweiler
Copy link
Contributor

Following on from #3115, this addresses some more of the warnings that are produced when running doxygen. (Note: Unlike the previous PR, these changes are not limited to changes to the documentation. For example, changing int type specifiers to equivalent types to help Doxygen matching things up.)

This PR addresses some of the issues in java_bytecode, goto-programs, util and cbmc.

Please see the individual commits for details.

  • Each commit message has a non-empty body, explaining why the change was made.
  • My contribution is formatted in line with CODING_STANDARD.md.
  • Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • Regression or unit tests are included, or existing tests cover the modified code (in this case I have detailed which ones those are in the commit message).
  • My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • White-space or formatting changes outside the feature-related changed lines are in commits of their own.

@@ -19,7 +19,7 @@ class goto_model_functiont;
/// Replace calls to nondet library functions with an internal nondet
/// representation.
/// \param goto_model: The goto program to modify.
void replace_java_nondet(goto_modelt &);
void replace_java_nondet(goto_modelt &goto_model);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⛏️ Probably the fix is to move the documentation into the cpp file as per coding guidelines.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@@ -695,7 +695,7 @@ inline typet java_type_from_string_with_exception(
}

/// Get the index in the subtypes array for a given component.
/// \param t The type we search for the subtypes in.
/// \param gen_types The subtypes array.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit-pick: add a colon after gen_types as is recommended in the coding guidelines (but arguably it's not done here for the other parameters).

@@ -261,6 +261,8 @@ bool read_object_and_link(

/// \brief reads an object file, and also updates the config
/// \param file_name file name of the goto binary
/// \param dest_symbol_table symbol table to update
/// \param dest_functions collection of goto functions to update
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit-pick as above: add colons

@@ -79,7 +79,7 @@ class symbol_typet:public typet

/// Check whether a reference to a typet is a \ref symbol_typet.
/// \param type Source type.
/// \return True if \param type is a \ref symbol_typet.
/// \return True if type is a \ref symbol_typet.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok for correct syntax, but is there some way to make Doxygen understand that this "type" refers to the named parameter "type"? I believe this is what the author intended.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't find a way to explicitly link it to the parameter. I tried adding emphasis, or marking it as code, but I think it looks best as plain text.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about using \p?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hadn't seen that, thanks. It certainly looks from the Doxygen documentation like that is the way to go (https://www.stack.nl/~dimitri/doxygen/manual/commands.html#cmdp). Their example looks good:

screen shot 2018-10-15 at 14 25 02

However, it doesn't look so good in the documentation generated for cbmc:

screen shot 2018-10-15 at 14 20 51

I guess it's probably best to use the \p in the cbmc documentation now, and then possibly (in future) consider changing the cbmc documentation formatting so that it is more like the standard Doxygen formatting.

@@ -19,7 +19,7 @@ class goto_model_functiont;
/// Replace calls to nondet library functions with an internal nondet
/// representation.
/// \param goto_model: The goto program to modify.
void replace_java_nondet(goto_modelt &);
void replace_java_nondet(goto_modelt &goto_model);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Copy link
Contributor

@allredj allredj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Passed Diffblue compatibility checks (cbmc commit: 21c7bc9).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/87929992

Doxygen produces warnings if some parameters are documentated and not
others, or if there is documentation for parameters which don't exist.
@johnnonweiler
Copy link
Contributor Author

@tautschnig I have moved the documentation to the cpp file, and added some colons.

Copy link
Contributor

@allredj allredj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR failed Diffblue compatibility checks (cbmc commit: cfe83b9).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/87952598
Status will be re-evaluated on next push.
Please contact @peterschrammel, @thk123, or @allredj for support.

Common spurious failures:

  • the cbmc commit has disappeared in the mean time (e.g. in a force-push)
  • the author is not in the list of contributors (e.g. first-time contributors).

The incompatibility may have been introduced by an earlier PR. In that case merging this
PR should be avoided unless it fixes the current incompatibility.

Copy link
Contributor

@allredj allredj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Passed Diffblue compatibility checks (cbmc commit: 20a8fe5).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/87954380

John Nonweiler added 4 commits October 15, 2018 14:32
Before this commit, get_xml_options had the parameters
"(const class xmlt &xml, cmdlinet &cmdline)" in the header file, and
"(const xmlt &xml, cmdlinet &cmdline)" in the cpp file.  Doxygen then
produced a warning "no matching class member found".  This commit
adds a forward declaration "class xmlt;" in the header file, so that
both versions of get_xml_options can have identical parameter lists.
Replace 'signed int' with 'int', and 'unsigned int' with 'unsigned',
so that .cpp and .h files are consistent, and doxygen doesn't get
confused
A doxygen \param comment in the header file was referring to the
'goto_model' parameter which was named only in the cpp file, and doxygen
complained that it could not find the parameter.

(Moved other comments for consistency.)
Doxygen was warning that the argument 'type' has muliple @param
documentation sections, and producing incorrect documentation.
Copy link
Contributor

@allredj allredj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Passed Diffblue compatibility checks (cbmc commit: 48061b4).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/87966511

@tautschnig tautschnig merged commit 589e565 into diffblue:develop Oct 15, 2018
@johnnonweiler johnnonweiler deleted the doc/reduce-doxygen-warnings-5 branch October 16, 2018 07:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants