[compiler-rt] [scudo] Make comment compatible with gcc (PR #106137)

Caslyn Tonelli via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 26 13:46:12 PDT 2024


https://github.com/Caslyn created https://github.com/llvm/llvm-project/pull/106137

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 PR places an innocuous '.' following the '\' so that the comment can compile with gcc.

>From 044786ad9ed1bbe045b3990310c5de218ee1b0cf Mon Sep 17 00:00:00 2001
From: Caslyn Tonelli <caslyn at google.com>
Date: Mon, 26 Aug 2024 13:35:10 -0700
Subject: [PATCH] [scudo] Make comment compatible with gcc

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 PR places an innocuous '.' following the '\' so that the comment
can compile with gcc.
---
 compiler-rt/lib/scudo/standalone/secondary.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/compiler-rt/lib/scudo/standalone/secondary.h b/compiler-rt/lib/scudo/standalone/secondary.h
index 985e2392641ae2..0690cb65b68468 100644
--- a/compiler-rt/lib/scudo/standalone/secondary.h
+++ b/compiler-rt/lib/scudo/standalone/secondary.h
@@ -426,7 +426,7 @@ class MapAllocatorCache {
     //  The difference between the retrieved memory chunk and the request
     //  size is at most MaxAllowedFragmentedPages
     //
-    //  / MaxAllowedFragmentedPages * PageSize \
+    //  / MaxAllowedFragmentedPages * PageSize \.
     // +--------------------------+-------------+
     // |                          |             |
     // +--------------------------+-------------+



More information about the llvm-commits mailing list