[libc-commits] [libc] [libc] Add missing const qualifiers to a few functions in <time.h> (PR #185311)
Alexey Samsonov via libc-commits
libc-commits at lists.llvm.org
Sun Mar 8 11:35:03 PDT 2026
https://github.com/vonosmas created https://github.com/llvm/llvm-project/pull/185311
`asctime_r`, `gmtime`, and `gmtime_r` were missing const-qualifiers for a first function argument. Add them to fix generated `<time.h>` header.
Implementation headers / source files are declaring arguments correctly.
>From de5e3b3ff11d80468921fe2b840bac939d6f87a7 Mon Sep 17 00:00:00 2001
From: Alexey Samsonov <vonosmas at gmail.com>
Date: Sun, 8 Mar 2026 18:32:06 +0000
Subject: [PATCH] [libc] Add missing const qualifiers to a few functions in
<time.h>
`asctime_r`, `gmtime`, and `gmtime_r` were missing const-qualifiers for
a first function argument. Add them to fix generated `<time.h>` header.
Implementation headers / source files are declaring arguments correctly.
---
libc/include/time.yaml | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/libc/include/time.yaml b/libc/include/time.yaml
index c2b8a1e4cfb8e..bf68da326ccd4 100644
--- a/libc/include/time.yaml
+++ b/libc/include/time.yaml
@@ -26,7 +26,7 @@ functions:
- stdc
return_type: char *
arguments:
- - type: struct tm *
+ - type: const struct tm *
- type: char *
- name: ctime
standard:
@@ -93,13 +93,13 @@ functions:
- stdc
return_type: struct tm *
arguments:
- - type: time_t *
+ - type: const time_t *
- name: gmtime_r
standard:
- stdc
return_type: struct tm *
arguments:
- - type: time_t *
+ - type: const time_t *
- type: struct tm *
- name: mktime
standard:
More information about the libc-commits
mailing list