strftime.c needs a declaration of the system's strftime() function.
But this declaration is not ISO C 23 compliant: In ISO C 23 an
empty parameter list no longer denotes (...) but actually an empty
list of arguments.

This patch fixes it. Alternatively, we could remove this declaration:
Due to the wide use of C++, systems which don't declare their libc
functions (like SunOS 4.1) are not in use any more.


2024-02-07  Bruno Haible  <[email protected]>

        nstrftime: Modernize.
        * lib/strftime.c (__strftime_internal): Make the strftime fallback
        declaration ISO C 23 compliant.

diff --git a/lib/strftime.c b/lib/strftime.c
index cf0a81d95e..bd519e36ab 100644
--- a/lib/strftime.c
+++ b/lib/strftime.c
@@ -868,7 +868,7 @@ __strftime_internal (STREAM_OR_CHAR_T *s, STRFTIME_ARG 
(size_t maxsize)
                "#define strftime rpl_strftime".  */
 # ifdef strftime
 #  undef strftime
-            size_t strftime ();
+            size_t strftime (char *, size_t, const char *, struct tm const *);
 # endif
 
             /* The space helps distinguish strftime failure from empty




Reply via email to