From 217958d88713b5dc73d366d24dd64b2b311b86fe Mon Sep 17 00:00:00 2001 From: Lasse Collin Date: Mon, 11 Sep 2023 19:03:35 +0300 Subject: xz, xzdec, lzmainfo: Use tuklib_attr_noreturn. For compatibility with C23's [[noreturn]], tuklib_attr_noreturn must be at the beginning of declaration (before "extern" or "static", and even before any GNU C's __attribute__). This commit also moves all other function attributes to the beginning of function declarations. "extern" is kept at the beginning of a line so the attributes are listed on separate lines before "extern" or "static". --- src/xzdec/xzdec.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/xzdec') diff --git a/src/xzdec/xzdec.c b/src/xzdec/xzdec.c index e9645c3f..10ce4e82 100644 --- a/src/xzdec/xzdec.c +++ b/src/xzdec/xzdec.c @@ -47,7 +47,8 @@ static int display_errors = 2; -static void lzma_attribute((__format__(__printf__, 1, 2))) +lzma_attribute((__format__(__printf__, 1, 2))) +static void my_errorf(const char *fmt, ...) { va_list ap; @@ -64,7 +65,8 @@ my_errorf(const char *fmt, ...) } -static void lzma_attribute((__noreturn__)) +tuklib_attr_noreturn +static void help(void) { printf( @@ -88,7 +90,8 @@ PACKAGE_NAME " home page: <" PACKAGE_URL ">\n", progname); } -static void lzma_attribute((__noreturn__)) +tuklib_attr_noreturn +static void version(void) { printf(TOOL_FORMAT "dec (" PACKAGE_NAME ") " LZMA_VERSION_STRING "\n" -- cgit v1.2.3