[libc-commits] [libc] Resolve multi-line comment error (PR #117636)

Caslyn Tonelli via libc-commits libc-commits at lists.llvm.org
Mon Nov 25 14:22:05 PST 2024


https://github.com/Caslyn created https://github.com/llvm/llvm-project/pull/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.

>From 934a20329c6b9057207ad23262cf1b28d9719f83 Mon Sep 17 00:00:00 2001
From: Caslyn Tonelli <caslyn at google.com>
Date: Mon, 25 Nov 2024 14:19:48 -0800
Subject: [PATCH] Resolve multi-line comment error

---
 libc/src/__support/common.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

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



More information about the libc-commits mailing list