[llvm-bugs] [Bug 38858] New: C documentation ignored for documented Macros

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Sep 6 15:44:15 PDT 2018


https://bugs.llvm.org/show_bug.cgi?id=38858

            Bug ID: 38858
           Summary: C documentation ignored for documented Macros
           Product: clang
           Version: 7.0
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: libclang
          Assignee: unassignedclangbugs at nondot.org
          Reporter: bo at bowild.com
                CC: klimek at google.com, llvm-bugs at lists.llvm.org

Created attachment 20851
  --> https://bugs.llvm.org/attachment.cgi?id=20851&action=edit
Example C file that demonstrates the issue.

clang fails to report documentation for Macros.

clang properly reports documentation for most symbols (documentation for
functions and global variables) but fails to report any documentation for
macros.

For IDE purposes, (for example, when using clang with vim or SublimeText3),
this could result in the mistaken belief that no documentation about the macro
exists, even if the macro has specific instructions or warnings documenting
it's existence / use.

This is especially frustrating when using macros to shadow C functions in order
to implement "named arguments" (using a struct and __VA_ARGS__). In these cases
the documentation is totally lost.

The following C file will demonstrate the issue:

```c

/**
 * Function documentation is properly reported to the IDE.
 */
static int my_noop(void) { return 1; }

/**
 * Global variable documentation is also reported to the IDE.
 */
static int my_noop_i = 0;

/**
 * Why does this documentation not show?.
 */
#define NOOP

int main(void) {
  my_noop_i = my_noop();
  NOOP;
  return 0;
}
```

Note: might be related to bug #35424

-- 
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/20180906/ec721eea/attachment.html>


More information about the llvm-bugs mailing list