Skip to content
  • Jan Kneschke's avatar
    3284ab61
    Bug#30977195 doc-comment warnings for conditional function params · 3284ab61
    Jan Kneschke authored
    Problem
    -------
    
    building with clang and CMAKE_CXX_CFLAGS="-Wdocumetnation" reports
    warnings parameters that are documented, but not in the function
    declaration.
    
    E.g.:
    
        /** Gets the desired bits for a given page from a bitmap page.
        @param[in]      page            bitmap page
        @param[in]      page_id         page id whose bits to get
        @param[in]      page_size       page size */
        @param[in]      latch_type      MTR_MEMO_PAGE_X_FIX, MTR_MEMO_BUF_FIX, ...
        @param[in,out]  mtr             mini-transaction holding latch_type on the
        bitmap page
        @param[in]      bit             IBUF_BITMAP_FREE, IBUF_BITMAP_BUFFERED, ...
        @return value of bits */
        UNIV_INLINE
        ulint ibuf_bitmap_page_get_bits_low(const page_t *page,
                                            const page_id_t &page_id,
                                            const page_size_t &page_size,
        #ifdef UNIV_DEBUG
                                            ulint latch_type, mtr_t *mtr,
        #endif /* UNIV_DEBUG */
                                            ulint bit) {
        ...
    
    leads to:
    
    - latch_type
    - mtr
    
    be documented even though they aren't in functions prototype if UNIV_DEBUG
    isn't defined.
    
    Change
    ------
    
    - split doc-comment into several parts
    - ifdef doc-comment parts in the same way as the function params
    
    RB: 23993
    3284ab61
    Bug#30977195 doc-comment warnings for conditional function params
    Jan Kneschke authored
    Problem
    -------
    
    building with clang and CMAKE_CXX_CFLAGS="-Wdocumetnation" reports
    warnings parameters that are documented, but not in the function
    declaration.
    
    E.g.:
    
        /** Gets the desired bits for a given page from a bitmap page.
        @param[in]      page            bitmap page
        @param[in]      page_id         page id whose bits to get
        @param[in]      page_size       page size */
        @param[in]      latch_type      MTR_MEMO_PAGE_X_FIX, MTR_MEMO_BUF_FIX, ...
        @param[in,out]  mtr             mini-transaction holding latch_type on the
        bitmap page
        @param[in]      bit             IBUF_BITMAP_FREE, IBUF_BITMAP_BUFFERED, ...
        @return value of bits */
        UNIV_INLINE
        ulint ibuf_bitmap_page_get_bits_low(const page_t *page,
                                            const page_id_t &page_id,
                                            const page_size_t &page_size,
        #ifdef UNIV_DEBUG
                                            ulint latch_type, mtr_t *mtr,
        #endif /* UNIV_DEBUG */
                                            ulint bit) {
        ...
    
    leads to:
    
    - latch_type
    - mtr
    
    be documented even though they aren't in functions prototype if UNIV_DEBUG
    isn't defined.
    
    Change
    ------
    
    - split doc-comment into several parts
    - ifdef doc-comment parts in the same way as the function params
    
    RB: 23993
Loading