[libc-commits] [libc] [libc] Stub out message catalog functions from <nl_types.h> (PR #164360)

via libc-commits libc-commits at lists.llvm.org
Mon Oct 20 22:53:58 PDT 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 origin/main HEAD --extensions h,cpp -- libc/include/llvm-libc-types/nl_catd.h libc/src/nl_types/catclose.cpp libc/src/nl_types/catclose.h libc/src/nl_types/catgets.cpp libc/src/nl_types/catgets.h libc/src/nl_types/catopen.cpp libc/src/nl_types/catopen.h libc/test/src/nl_types/nl_types_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-types/nl_catd.h b/libc/include/llvm-libc-types/nl_catd.h
index f80a2df8c..ccdb02067 100644
--- a/libc/include/llvm-libc-types/nl_catd.h
+++ b/libc/include/llvm-libc-types/nl_catd.h
@@ -9,7 +9,6 @@
 #ifndef LLVM_LIBC_TYPES_NL_CATD_H
 #define LLVM_LIBC_TYPES_NL_CATD_H
 
-typedef void* nl_catd;
+typedef void *nl_catd;
 
 #endif // LLVM_LIBC_TYPES_NL_CATD_H
-
diff --git a/libc/src/nl_types/catclose.cpp b/libc/src/nl_types/catclose.cpp
index 2cfc3686f..09b521bea 100644
--- a/libc/src/nl_types/catclose.cpp
+++ b/libc/src/nl_types/catclose.cpp
@@ -19,5 +19,3 @@ LLVM_LIBC_FUNCTION(int, catclose, ([[maybe_unused]] nl_catd catalog)) {
 }
 
 } // namespace LIBC_NAMESPACE_DECL
-
-
diff --git a/libc/src/nl_types/catclose.h b/libc/src/nl_types/catclose.h
index 5cbce4fcf..433020a9d 100644
--- a/libc/src/nl_types/catclose.h
+++ b/libc/src/nl_types/catclose.h
@@ -19,4 +19,3 @@ int catclose(nl_catd catalog);
 } // namespace LIBC_NAMESPACE_DECL
 
 #endif // LLVM_LIBC_SRC_NL_TYPES_CATCLOSE_H
-
diff --git a/libc/src/nl_types/catgets.cpp b/libc/src/nl_types/catgets.cpp
index c2f289c9d..5e6341516 100644
--- a/libc/src/nl_types/catgets.cpp
+++ b/libc/src/nl_types/catgets.cpp
@@ -13,14 +13,13 @@
 
 namespace LIBC_NAMESPACE_DECL {
 
-LLVM_LIBC_FUNCTION(char*, catgets, ([[maybe_unused]] nl_catd catalog,
-			            [[maybe_unused]] int set_number,
-			            [[maybe_unused]] int message_number,
-				    const char* message)) {
+LLVM_LIBC_FUNCTION(char *, catgets,
+                   ([[maybe_unused]] nl_catd catalog,
+                    [[maybe_unused]] int set_number,
+                    [[maybe_unused]] int message_number, const char *message)) {
   // Message catalogs are not implemented.
   // Return backup message regardless of input.
-  return const_cast<char*>(message);
+  return const_cast<char *>(message);
 }
 
 } // namespace LIBC_NAMESPACE_DECL
-
diff --git a/libc/src/nl_types/catgets.h b/libc/src/nl_types/catgets.h
index c8b53d7aa..c909bec44 100644
--- a/libc/src/nl_types/catgets.h
+++ b/libc/src/nl_types/catgets.h
@@ -20,5 +20,3 @@ char *catgets(nl_catd catalog, int set_number, int message_number,
 } // namespace LIBC_NAMESPACE_DECL
 
 #endif // LLVM_LIBC_SRC_NL_TYPES_CATGETS_H
-
-
diff --git a/libc/src/nl_types/catopen.cpp b/libc/src/nl_types/catopen.cpp
index f2755cfd9..4f8243449 100644
--- a/libc/src/nl_types/catopen.cpp
+++ b/libc/src/nl_types/catopen.cpp
@@ -14,12 +14,12 @@
 
 namespace LIBC_NAMESPACE_DECL {
 
-LLVM_LIBC_FUNCTION(nl_catd, catopen, ([[maybe_unused]] const char *name,
-			              [[maybe_unused]] int flag)) {
+LLVM_LIBC_FUNCTION(nl_catd, catopen,
+                   ([[maybe_unused]] const char *name,
+                    [[maybe_unused]] int flag)) {
   // Message catalogs are not implemented. Return error regardless of input.
   libc_errno = EINVAL;
   return reinterpret_cast<nl_catd>(-1);
 }
 
 } // namespace LIBC_NAMESPACE_DECL
-
diff --git a/libc/test/src/nl_types/nl_types_test.cpp b/libc/test/src/nl_types/nl_types_test.cpp
index 9c5389203..5ae5c5ab2 100644
--- a/libc/test/src/nl_types/nl_types_test.cpp
+++ b/libc/test/src/nl_types/nl_types_test.cpp
@@ -25,9 +25,9 @@ TEST_F(LlvmLibcNlTypesTest, CatcloseFails) {
 }
 
 TEST_F(LlvmLibcNlTypesTest, CatgetsFails) {
-  const char* message = "message";
+  const char *message = "message";
   // Note that we test for pointer equality here, since catgets
   // is expected to return the input argument as-is.
   ASSERT_EQ(LIBC_NAMESPACE::catgets(nullptr, 0, 0, message),
-            const_cast<char*>(message));
+            const_cast<char *>(message));
 }

``````````

</details>


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


More information about the libc-commits mailing list