Skip to content

[scudo] Make comment compatible with gcc #106137

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 26, 2024
Merged

[scudo] Make comment compatible with gcc #106137

merged 2 commits into from
Aug 26, 2024

Conversation

Caslyn
Copy link
Contributor

@Caslyn Caslyn commented Aug 26, 2024

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.

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.
@llvmbot
Copy link
Member

llvmbot commented Aug 26, 2024

@llvm/pr-subscribers-compiler-rt-sanitizer

Author: Caslyn Tonelli (Caslyn)

Changes

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.


Full diff: https://github.com/llvm/llvm-project/pull/106137.diff

1 Files Affected:

  • (modified) compiler-rt/lib/scudo/standalone/secondary.h (+1-1)
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 \.
     // +--------------------------+-------------+
     // |                          |             |
     // +--------------------------+-------------+

@Caslyn Caslyn requested a review from fabio-d August 26, 2024 20:47
Copy link
Contributor

@fmayer fmayer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

alternatively we could change it to | on both ends. no preference on my end.

@Caslyn
Copy link
Contributor Author

Caslyn commented Aug 26, 2024

Thanks @fmayer and @ChiaHungDuan for the review - moving forward with merging.

@Caslyn Caslyn merged commit 31204b4 into llvm:main Aug 26, 2024
5 of 6 checks passed
@Caslyn Caslyn deleted the fix-comment branch August 26, 2024 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants