[libc-commits] [libc] bbb1c83 - [libc] Add missing const qualifiers to a few functions in <time.h> (#185311)

via libc-commits libc-commits at lists.llvm.org
Tue Mar 10 10:09:00 PDT 2026


Author: Alexey Samsonov
Date: 2026-03-10T10:08:55-07:00
New Revision: bbb1c831d19cb66f0e5355a43d669d3ee1d9ba54

URL: https://github.com/llvm/llvm-project/commit/bbb1c831d19cb66f0e5355a43d669d3ee1d9ba54
DIFF: https://github.com/llvm/llvm-project/commit/bbb1c831d19cb66f0e5355a43d669d3ee1d9ba54.diff

LOG: [libc] Add missing const qualifiers to a few functions in <time.h> (#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.

Added: 
    

Modified: 
    libc/include/time.yaml

Removed: 
    


################################################################################
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