[libc-commits] [libc] [libc] Reimplement IN6_IS_ADDR_* macros using statement expressions (PR #209772)

via libc-commits libc-commits at lists.llvm.org
Wed Jul 15 07:39:34 PDT 2026


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 origin/main HEAD --extensions h,cpp -- libc/include/llvm-libc-macros/netinet-in-macros.h libc/test/include/netinet_in_test.cpp --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

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

``````````diff
diff --git a/libc/include/llvm-libc-macros/netinet-in-macros.h b/libc/include/llvm-libc-macros/netinet-in-macros.h
index d7c9d2d2a..1636736d3 100644
--- a/libc/include/llvm-libc-macros/netinet-in-macros.h
+++ b/libc/include/llvm-libc-macros/netinet-in-macros.h
@@ -49,8 +49,8 @@
 
 #define __IN6_IS_ADDR_LOOPBACK(a)                                              \
   ((a)->s6_addr32[0] == 0 && (a)->s6_addr32[1] == 0 &&                         \
-   (a)->s6_addr32[2] == 0 && (a)->s6_addr[12] == 0 &&                          \
-   (a)->s6_addr[13] == 0 && (a)->s6_addr[14] == 0 && (a)->s6_addr[15] == 1)
+   (a)->s6_addr32[2] == 0 && (a)->s6_addr[12] == 0 && (a)->s6_addr[13] == 0 && \
+   (a)->s6_addr[14] == 0 && (a)->s6_addr[15] == 1)
 
 #define IN6_IS_ADDR_UNSPECIFIED(a)                                             \
   (__extension__({                                                             \

``````````

</details>


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


More information about the libc-commits mailing list