[libc-commits] [libc] Resolve multi-line comment error (PR #117636)
via libc-commits
libc-commits at lists.llvm.org
Mon Nov 25 14:22:37 PST 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-libc
Author: Caslyn Tonelli (Caslyn)
<details>
<summary>Changes</summary>
gcc interprets a backslash '\' as the last char before a new line as a line continuation character, even in a comment context. This can produce an "error: multi-line comment [-Werror=comment]".
This removes the line continuation so that the comment can compile with gcc.
---
Full diff: https://github.com/llvm/llvm-project/pull/117636.diff
1 Files Affected:
- (modified) libc/src/__support/common.h (+1-2)
``````````diff
diff --git a/libc/src/__support/common.h b/libc/src/__support/common.h
index 79803a346f692e..a9beeb38cc1fa7 100644
--- a/libc/src/__support/common.h
+++ b/libc/src/__support/common.h
@@ -27,8 +27,7 @@
//
// For examples:
// #define LLVM_LIBC_FUNCTION_ATTR_memcpy LLVM_LIBC_EMPTY, [[gnu::weak]]
-// #define LLVM_LIBC_FUNCTION_ATTR_memchr LLVM_LIBC_EMPTY, [[gnu::weak]] \
-// [[gnu::visibility("default")]]
+// #define LLVM_LIBC_FUNCTION_ATTR_memchr LLVM_LIBC_EMPTY, [[gnu::weak]] [[gnu::visibility("default")]]
#define LLVM_LIBC_EMPTY
#define GET_SECOND(first, second, ...) second
``````````
</details>
https://github.com/llvm/llvm-project/pull/117636
More information about the libc-commits
mailing list