-
-
Notifications
You must be signed in to change notification settings - Fork 201
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
"WARNING: Duplicate declaration" for header file declaration and .c implementation #405
Comments
I believe the function contract is usually documented in the header file, though this should not matter. If I remember correctly this warning is caused when you list the same "doxygen object" in the RST multiple times. For example in both Also see #321, #378 and Sphinx upstream sphinx-doc/sphinx#4981. Does this help or am I missing something still? |
@melvinvermeeren Thank you for the reply. But the only thing I use for now about doxygen object is |
On my projects I have a huge number of |
@CareF the attached example renders to the following: The documentation for |
@melvinvermeeren Thank you for the advice! |
What I would do is document the "usage of the API" in the proper docs, through doxygen/sphinx, and document internal notes, for the implementation but not the function contract, as regular comments inside the source files itself since anyone editing the source will see them inside the As a bonus this structure will help keep the main generated docs clean with just the public API and function contracts, the rationale for implementation decisions stays next to the implementation itself. (For bigger software I find it useful to have both a public API, which is documented, and an internal API, which is also documented. This is useful for when you have standalone-ish subsystems in the software, which do have function contracts but are not available to whoever is using the library itself. I believe this is not needed in your case.) |
Thank you @melvinvermeeren ! |
There are some workarounds by passing the |
As @melvinvermeeren mentions there are some basic problems with index-like lists which triggers the warnings, which will be fixed when the alias support is implemented in Sphinx and Breathe uses it. Note that this problem has always been there, but the explicit warnings are relatively new. |
Hi all, I have noticed this issue after upgrade:
Personally I like no explicit warnings as it was before. On the index, for each duplicate documentation entry there is a reference in square brackets [1], [2], etc., see below how it looks like for functions I am happy with this method of handling duplicates on the index. I am not sure if this is the same as "index-like lists" mentioned by @jakobandersen above or there are some other issues elsewhere. We need duplicate documentation entries for user convenience to document old (Make) and new (CMake) build systems. The workflows for each system is different and before deprecation of the old build system we need to maintain documentation for both. @CareF thank you for documenting this issue and I am happy to see some discussion going on already! My nightmare is an old issue entered months or years ago with nobody interested in resolution but me :) |
I guess the main purpose of this issue has been achieved earlier. Improvements will happen eventually through other issues. Closing for now. |
I think it's probably I am not using it correctly, but I am trying to use breathe for a small C module in a Python project. In the C code I have a function declared in a header file and implemented in a .c file. Example:
I believe it's a very common way of arranging C code, but when I do this with doxygen+breathe, I got warning
WARNING: Duplicate declaration
, and also at first error but fixed I believe #394 with git version of sphinx. I also saw sphinx-doc/sphinx#4820 but it looks like a different case.I think it's that doxygen creates symbol for the
foo
in both header file and .c file. So what should be the practice for such use case?Thank you!
The text was updated successfully, but these errors were encountered: