-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Added support for suppressing certain cpp domain warnings. #7851
Conversation
Signed-off-by: RaulSanchez <raul@eprosima.com>
942b72f
to
13a27e2
Compare
Can you elaborate a bit on the rationale behind this? Perhaps there are better ways to solve the original problem. |
It would be better to start with the structure of the project to understand why it is necessary to create a type for these two warnings. In the project I am documenting a C++ code with the following tools:
The following cases are presented in the project:
struct Time_t
{
int32_t seconds;
uint32_t nanosec;
...
Time_t(int32_t sec, uint32_t nsec);
}
...
const Time_t c_TimeZero(0,0); The object declaration in this manner causes Doxygen to render it as a function and therefore Breathe must load it as a function (
It is important to mention that this pull request only adds the type and subtype to the warnings previously described to be able to suppress them, this is, it is not a functionality that will be executed for all users. |
I don't think either of those problems are in Sphinx.
However, your example lead me to realize that even when changing the directive to a variable, there will be a problem, as the parenthesised initializer is not recognized. I'll get that fixed soon. Thanks. |
The source of the problems may not be Sphinx but that's where the warnings are triggered. So I think there should be some way to suppress certain specific warnings in sphinx. I know that this is already implemented (
<path/to/rst/file>:<line>: WARNING: Duplicate declaration, bool operator== (const Time_t &t1, const Time_t &t2)
|
That is indeed a warning from Sphinx. While some other types of warnings are really more notices (e.g., those hidden in non-nitpicky mode), both the duplicate declaration and parsing warnings are symptoms some actual problems that should be addressed. I'll therefore close the PR. |
Subject: This pull request adds two tags for the suppression of warnings raised by the cpp domain.
Feature or Bugfix
Purpose
This pull request is intended to continue the expansion of the work implemented in #2346 through the addition of new types for the suppression of warnings. Specifically, this pull request focuses on warnings raised from the cpp domain when declaring C++ functions and variables.
A new type and two subtypes of warning are added.
cpp.duplicate_declaration
cpp.parse_function_declaration
Detail
cpp.duplicate_declaration
: Removes the warnings caused by the duplicate declaration of functions. The purpose of removing this warning is to allow functions with the same name to exist within the same project.cpp.parse_function_declaration
: Removes warnings caused by errors in the parsing of function declarations. This warning occurs in function statements such as the following:const MyStruct const_struct(0,0)