Skip to content

Commit 7138846

Browse files
committed
doxygen: remove @return command if function return void
When doxygen is upgraded to v1.9.8 (on ubuntu 24.04), doxygen reports: "doxygen error: found documented return type for xxx that does not return anything" for those functions which return void but declare "@return" in doxygen comment. Solution: remove "@return" for those cases, and update guide document for how to write doxgen comment for functions. Signed-off-by: Chen Wang <[email protected]>
1 parent 1aef0db commit 7138846

File tree

3 files changed

+6
-12
lines changed

3 files changed

+6
-12
lines changed

components/drivers/audio/dev_audio.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -751,8 +751,6 @@ int rt_audio_samplerate_to_speed(rt_uint32_t bitValue)
751751
* See _audio_send_replay_frame for details
752752
*
753753
* @param[in] audio pointer to audio device
754-
*
755-
* @return void
756754
*/
757755
void rt_audio_tx_complete(struct rt_audio_device *audio)
758756
{
@@ -768,8 +766,6 @@ void rt_audio_tx_complete(struct rt_audio_device *audio)
768766
* @param[in] pbuf pointer ro data to be received
769767
*
770768
* @param[in] len buffer size
771-
*
772-
* @return void
773769
*/
774770
void rt_audio_rx_done(struct rt_audio_device *audio, rt_uint8_t *pbuf, rt_size_t len)
775771
{

components/drivers/include/drivers/dev_can.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -709,8 +709,6 @@ rt_err_t rt_hw_can_register(struct rt_can_device *can,
709709
*
710710
* @param[in] can A pointer to the CAN device structure.
711711
* @param[in] event The interrupt event mask, indicating the cause of the interrupt.
712-
*
713-
* @return void
714712
*/
715713
void rt_hw_can_isr(struct rt_can_device *can, int event);
716714

documentation/0.doxygen/example/src/function.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,12 @@
3333
*
3434
* To documenting for functions, a comment block before the function
3535
* declaraion/definition is recommended to describe the general information
36-
* of the function. In the comment block, a `@brief` is required, a `@return`
37-
* is also required no matter if the function return values or not. `@param` is
38-
* required if any, and if it is provided, direction [in]/[out]/[in,out] should
39-
* be provide together. Other commands (such as `@note`) are optional.
36+
* of the function. In the comment block, a `@brief` is required. A `@return`
37+
* is also required if the function is intended to return a value, otherwise
38+
* if the function is implemented with a void return type, `@return` is not
39+
* required. `@param` is required if any, and if it is provided,
40+
* direction [in]/[out]/[in,out] should be provide together. Other commands
41+
* (such as `@note`) are optional.
4042
*
4143
* If you feel that the description of `@brief` is not enough, you
4244
* can add a detailed description part, which is also optional.
@@ -72,8 +74,6 @@
7274
*
7375
* @param[in] b Description of param b
7476
*
75-
* @return void
76-
*
7777
* @note This is a note for this structure, blah blah blah...
7878
*/
7979
void doxygen_example_func_foo(int a, int b)

0 commit comments

Comments
 (0)