From b861c3acc450294108a4d942fc9c4a44d772295f Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 30 Jun 2024 21:00:47 +0200 Subject: [PATCH] printf-posix: Document properly. * lib/stdio.in.h (printf): Add specification. * lib/vprintf.c (printf): Remove specification. --- ChangeLog | 4 ++++ lib/printf.c | 3 --- lib/stdio.in.h | 3 +++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3b6f777e85..36f4db7910 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2024-06-30 Bruno Haible + printf-posix: Document properly. + * lib/stdio.in.h (printf): Add specification. + * lib/vprintf.c (printf): Remove specification. + zprintf: New module. * lib/stdio.in.h (zprintf): New declaration. * lib/zprintf.c: New file, based on lib/vzprintf.c. diff --git a/lib/printf.c b/lib/printf.c index f89af7490e..f5305935b9 100644 --- a/lib/printf.c +++ b/lib/printf.c @@ -23,9 +23,6 @@ #include -/* Print formatted output to standard output. - Return string length of formatted string. On error, return a negative - value. */ int printf (const char *format, ...) { diff --git a/lib/stdio.in.h b/lib/stdio.in.h index 013c7a4ad1..38572382d4 100644 --- a/lib/stdio.in.h +++ b/lib/stdio.in.h @@ -1280,6 +1280,9 @@ _GL_CXXALIAS_SYS (zprintf, off64_t, (const char *restrict format, ...)); #endif #if @GNULIB_PRINTF_POSIX@ || @GNULIB_PRINTF@ +/* Prints formatted output to standard output. + Returns the number of bytes written to standard output. Upon failure, + returns a negative value with stdout's error indicator set. */ # if (@GNULIB_PRINTF_POSIX@ && @REPLACE_PRINTF@) \ || (@GNULIB_PRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@)) # if defined __GNUC__ || defined __clang__ -- 2.39.5