[LLVMbugs] [Bug 16713] New: Confusing/incorrect -Wdocumentation warning message with \def used on a function

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Jul 26 10:30:31 PDT 2013


http://llvm.org/bugs/show_bug.cgi?id=16713

            Bug ID: 16713
           Summary: Confusing/incorrect -Wdocumentation warning message
                    with \def used on a function
           Product: new-bugs
           Version: trunk
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: sean at rogue-research.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

-Wdocumentation found a bug, but the wording of the diagnostic is confusing and
incorrect.

This code is from libusb:

----------------------
#include <stdint.h>

/** \def libusb_le16_to_cpu
 * \ingroup misc
 * Convert a 16-bit value from little-endian to host-endian format. On
 * little endian systems, this function does nothing. On big endian systems,
 * the bytes are swapped.
 * \param x the little-endian value to convert
 * \returns the value in host-endian byte order
 */
#define libusb_le16_to_cpu libusb_cpu_to_le16

/** \def libusb_cpu_to_le16
 * \ingroup misc
 * Convert a 16-bit value from host-endian to little-endian format. On
 * little endian systems, this function does nothing. On big endian systems,
 * the bytes are swapped.
 * \param x the host-endian value to convert
 * \returns the value in little-endian byte order
 */
static inline uint16_t libusb_cpu_to_le16(const uint16_t x)
{
    union {
        uint8_t  b8[2];
        uint16_t b16;
    } _tmp;
    _tmp.b8[1] = x >> 8;
    _tmp.b8[0] = x & 0xff;
    return _tmp.b16;
}
----------------------

run clang:

$ clang -Wdocumentation test.c

test.c:13:5: warning: unknown command tag name 'def'; did you mean 'ref'?
[-Wdocumentation]
/** \def libusb_cpu_to_le16
    ^~~~
     ref

1) 'def' is not an "unknown command tag name" since it worked on line 3.
2) No, I did not mean "\ref", I meant "\fn" since the thing is a function not a
macro.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20130726/e235e3a2/attachment.html>


More information about the llvm-bugs mailing list