[libc-commits] [libc] [libc] Add backwards-compatibility macro to struct stat. (PR #182601)

via libc-commits libc-commits at lists.llvm.org
Fri Feb 20 14:14:36 PST 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-types/struct_stat.h libc/test/src/sys/time/utimes_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/struct_stat.h b/libc/include/llvm-libc-types/struct_stat.h
index 599194af6..ad9c5df60 100644
--- a/libc/include/llvm-libc-types/struct_stat.h
+++ b/libc/include/llvm-libc-types/struct_stat.h
@@ -34,11 +34,11 @@ struct stat {
   struct timespec st_ctim;
   blksize_t st_blksize;
   blkcnt_t st_blocks;
-  // Backwards compatibility macros for older kernel/standards
-  // that recorded timestamps in stat with one-second precision.
-  #define st_atime st_atim.tv_sec
-  #define st_mtime st_mtim.tv_sec
-  #define st_ctime st_ctim.tv_sec
+// Backwards compatibility macros for older kernel/standards
+// that recorded timestamps in stat with one-second precision.
+#define st_atime st_atim.tv_sec
+#define st_mtime st_mtim.tv_sec
+#define st_ctime st_ctim.tv_sec
 };
 
 #endif // LLVM_LIBC_TYPES_STRUCT_STAT_H

``````````

</details>


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


More information about the libc-commits mailing list