[compiler-rt] [compiler-rt][rtsan] adding setlinebuf/setbuffer interception. (PR #122018)

via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 7 15:47:10 PST 2025


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff c6f67b8e39a907fb96b715cae3ee90e4c1b248aa ff678277b20cfcfadc9fc6ae456d584a37558a89 --extensions cpp -- compiler-rt/lib/rtsan/rtsan_interceptors_posix.cpp compiler-rt/lib/rtsan/tests/rtsan_test_interceptors_posix.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/compiler-rt/lib/rtsan/rtsan_interceptors_posix.cpp b/compiler-rt/lib/rtsan/rtsan_interceptors_posix.cpp
index 7036cfbf79..6a5f4b91d1 100644
--- a/compiler-rt/lib/rtsan/rtsan_interceptors_posix.cpp
+++ b/compiler-rt/lib/rtsan/rtsan_interceptors_posix.cpp
@@ -348,20 +348,20 @@ INTERCEPTOR(int, setvbuf, FILE *stream, char *buf, int mode, size_t size) {
   return REAL(setvbuf)(stream, buf, mode, size);
 }
 
-#  if SANITIZER_LINUX
+#if SANITIZER_LINUX
 INTERCEPTOR(void, setlinebuf, FILE *stream) {
-#  else
+#else
 INTERCEPTOR(int, setlinebuf, FILE *stream) {
-#  endif
+#endif
   __rtsan_notify_intercepted_call("setlinebuf");
   return REAL(setlinebuf)(stream);
 }
 
-#  if SANITIZER_LINUX
+#if SANITIZER_LINUX
 INTERCEPTOR(void, setbuffer, FILE *stream, char *buf, size_t size) {
-#  else
+#else
 INTERCEPTOR(void, setbuffer, FILE *stream, char *buf, int size) {
-#  endif
+#endif
   __rtsan_notify_intercepted_call("setbuffer");
   return REAL(setbuffer)(stream, buf, size);
 }

``````````

</details>


https://github.com/llvm/llvm-project/pull/122018


More information about the llvm-commits mailing list