diff options
author | наб <[email protected]> | 2021-06-05 13:14:12 +0200 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2021-07-26 12:07:15 -0700 |
commit | 5dbf6c5a66d3de65f1b0436c8e83097dd49ff059 (patch) | |
tree | 59d33400d59c4935afcd37bbbf0263dd96cac71f /lib/libuutil | |
parent | 13737094503a38a219f1ffe641cb257bb4b879cb (diff) |
Replace /*PRINTFLIKEn*/ with attribute(printf)
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Ahelenia Ziemiańska <[email protected]>
Issue #12201
Diffstat (limited to 'lib/libuutil')
-rw-r--r-- | lib/libuutil/uu_pname.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/lib/libuutil/uu_pname.c b/lib/libuutil/uu_pname.c index a6a0f2266..28c4a8a9c 100644 --- a/lib/libuutil/uu_pname.c +++ b/lib/libuutil/uu_pname.c @@ -38,9 +38,6 @@ #include <wchar.h> #include <unistd.h> -static const char PNAME_FMT[] = "%s: "; -static const char ERRNO_FMT[] = ": %s\n"; - static const char *pname; static void @@ -85,16 +82,16 @@ uu_alt_exit(int profile) } } -static void +static __attribute__((format(printf, 2, 0))) void uu_warn_internal(int err, const char *format, va_list alist) { if (pname != NULL) - (void) fprintf(stderr, PNAME_FMT, pname); + (void) fprintf(stderr, "%s: ", pname); (void) vfprintf(stderr, format, alist); if (strrchr(format, '\n') == NULL) - (void) fprintf(stderr, ERRNO_FMT, strerror(err)); + (void) fprintf(stderr, ": %s\n", strerror(err)); } void @@ -103,7 +100,6 @@ uu_vwarn(const char *format, va_list alist) uu_warn_internal(errno, format, alist); } -/*PRINTFLIKE1*/ void uu_warn(const char *format, ...) { @@ -113,7 +109,7 @@ uu_warn(const char *format, ...) va_end(alist); } -static void +static __attribute__((format(printf, 2, 0))) __NORETURN void uu_die_internal(int status, const char *format, va_list alist) { uu_warn_internal(errno, format, alist); @@ -137,7 +133,6 @@ uu_vdie(const char *format, va_list alist) uu_die_internal(UU_EXIT_FATAL, format, alist); } -/*PRINTFLIKE1*/ void uu_die(const char *format, ...) { @@ -153,7 +148,6 @@ uu_vxdie(int status, const char *format, va_list alist) uu_die_internal(status, format, alist); } -/*PRINTFLIKE2*/ void uu_xdie(int status, const char *format, ...) { |