[libc-commits] [libc] 4c91662 - [libc] Resolve multi-line comment error (#117636)
via libc-commits
libc-commits at lists.llvm.org
Mon Nov 25 15:01:04 PST 2024
Author: Caslyn Tonelli
Date: 2024-11-25T15:01:01-08:00
New Revision: 4c91662a519705c2d0b6e002214a3e307f09b373
URL: https://github.com/llvm/llvm-project/commit/4c91662a519705c2d0b6e002214a3e307f09b373
DIFF: https://github.com/llvm/llvm-project/commit/4c91662a519705c2d0b6e002214a3e307f09b373.diff
LOG: [libc] Resolve multi-line comment error (#117636)
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.
Added:
Modified:
libc/src/__support/common.h
Removed:
################################################################################
diff --git a/libc/src/__support/common.h b/libc/src/__support/common.h
index 79803a346f692e..42e8a79187facb 100644
--- a/libc/src/__support/common.h
+++ b/libc/src/__support/common.h
@@ -21,14 +21,15 @@
#define LLVM_LIBC_FUNCTION_ATTR
#endif
+// clang-format off
// Allow each function `func` to have extra attributes specified by defining:
// `LLVM_LIBC_FUNCTION_ATTR_func` macro, which should always start with
// "LLVM_LIBC_EMPTY, "
//
// 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")]]
+// clang-format on
#define LLVM_LIBC_EMPTY
#define GET_SECOND(first, second, ...) second
More information about the libc-commits
mailing list