-
Notifications
You must be signed in to change notification settings - Fork 28
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
getting WARNING: Invalid parameter name #67
Comments
I've been looking into this, and I think there's something funky going on with c'tors. I think it does 2 passes:
This kinda makes sense why the rendered docs behave as expected. My initial guess about duplicate param names (for different functions) doesn't seem to be the problem. I still think this warning could be a bit more descriptive like
Just as an experimental fix, I've wrapped sphinx-immaterial/sphinx_immaterial/cpp_domain_fixes.py Lines 890 to 892 in 163fe76
into if self.contentnode.parent["desctype"] != "class":
_cross_link_parameters(
app=self.env.app,
domain=domain,
content=self.contentnode,
symbols=symbols
) Now the docs render as expected and there are no warnings. |
Do I understand correctly that you have something like: .. cpp:class:: MyClass
:param _cepin: Description goes here.
.. cpp:function:: MyClass(int _cepin)
Constructor. That is, you are trying to document a constructor parameter within the description of the class itself? The current implementation assumes that you would only document constructor parameters within the description of the constructor, not the containing class. Note that we don't want to disable cross linking of all parameters for classes, because classes can have template parameters (just not function parameters), and |
Yes, but the param descriptions are part of the c'tor's function directive (not the class directive). .. cpp:class:: RF24
.. doxygenfunction:: RF24::RF24 (uint16_t _cepin, uint16_t _cspin, uint32_t _spi_speed=RF24_SPI_SPEED)
.. doxygenfunction:: RF24::RF24 (uint32_t _spi_speed=RF24_SPI_SPEED) |
Based on your feedback to #70 I think a better worded warning would be:
|
Agreed on the better warning name. Can you reproduce the constructor issue without using breathe? There may well be a bug but it would be easier to understand just using the plain cpp domain directives. |
.. cpp:class:: RF24
.. cpp:function:: RF24::RF24(uint16_t _cepin, uint16_t _cspin, uint32_t _spi_speed=RF24_SPI_SPEED)
:param _cepin: The pin attached to Chip Enable on the RF module
:param _cspin: The pin attached to Chip Select (often labeled CSN) on the radio module.
- For the Arduino Due board, the `Arduino Due extended SPI feature <https://www.arduino.cc/en/Reference/DueExtendedSPI>`_
is not supported. This means that the Due's pins 4, 10, or 52 are not mandated options (can use any digital output pin) for the radio's CSN pin.
:param _spi_speed: The SPI speed in Hz ie: 1000000 == 1Mhz
- Users can specify default SPI speed by modifying :c:macro:`RF24_SPI_SPEED` in :file:`RF24_config.h`
- For Arduino, the default SPI speed will only be properly configured this way on devices supporting SPI TRANSACTIONS
- Older/Unsupported Arduino devices will use a default clock divider & settings configuration
- For Linux: The old way of setting SPI speeds using BCM2835 driver enums has been removed as of v1.3.7
.. cpp:function:: RF24::RF24(uint32_t _spi_speed=RF24_SPI_SPEED)
:param _spi_speed: The SPI speed in Hz ie: 1000000 == 1Mhz
- Users can specify default SPI speed by modifying :c:macro:`RF24_SPI_SPEED` in :file:`RF24_config.h`
- For Arduino, the default SPI speed will only be properly configured this way on devices supporting SPI TRANSACTIONS
- Older/Unsupported Arduino devices will use a default clock divider & settings configuration
- For Linux: The old way of setting SPI speeds using BCM2835 driver enums has been removed as of v1.3.7 Pure RST does reproduce the warnings. I am also seeing the warnings' RST line number correspond to the end of the |
I will look into the parameter issue. The If you just want it to display as |
Okay, the issue is actually that |
Dude, I've been probing that function's code for hours to understand what it is actually doing. At best, I found a greater appreciation for your work... |
That is a sign that it needs better comments I guess. |
I'm now getting warnings saying
The only commonality that these parameters have is that they're used
as verbatim parameter names in multiple functions (in overloaded c'torand Arduino style, and each name begins with abegin()
)_
. I might be misunderstanding the problem here, but I doubt that the_
is the culprit (removing the_
didn't prevent the warning).EDITED: better diagnosis in first comment below
I'm guessing this warning should be saying "Non-unique parameter name" given thatit is generated fromsphinx-immaterial/sphinx_immaterial/cpp_domain_fixes.py
Lines 728 to 740 in 163fe76
However, I would argue that re-using parameter names for multiple functions is an accepted practice. So, we shouldn't raise warnings about it (which would cause RTD builds to fail fast).The text was updated successfully, but these errors were encountered: