aboutsummaryrefslogtreecommitdiff
path: root/src/xz/message.h
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2023-09-11 19:03:35 +0300
committerJia Tan <jiat0218@gmail.com>2023-10-31 01:03:25 +0800
commitb71b8922ef3971e5ccffd1e213888d44abe21d11 (patch)
tree2542fa029c9355df034f8a724a7cce7c587c348c /src/xz/message.h
parentRemove incorrect uses of __attribute__((__malloc__)). (diff)
downloadxz-b71b8922ef3971e5ccffd1e213888d44abe21d11.tar.xz
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".
Diffstat (limited to '')
-rw-r--r--src/xz/message.h30
1 files changed, 17 insertions, 13 deletions
diff --git a/src/xz/message.h b/src/xz/message.h
index b264f821..f608ec75 100644
--- a/src/xz/message.h
+++ b/src/xz/message.h
@@ -44,42 +44,44 @@ extern enum message_verbosity message_verbosity_get(void);
/// \brief Print a message if verbosity level is at least "verbosity"
///
/// This doesn't touch the exit status.
-extern void message(enum message_verbosity verbosity, const char *fmt, ...)
- lzma_attribute((__format__(__printf__, 2, 3)));
+lzma_attribute((__format__(__printf__, 2, 3)))
+extern void message(enum message_verbosity verbosity, const char *fmt, ...);
/// \brief Prints a warning and possibly sets exit status
///
/// The message is printed only if verbosity level is at least V_WARNING.
/// The exit status is set to WARNING unless it was already at ERROR.
-extern void message_warning(const char *fmt, ...)
- lzma_attribute((__format__(__printf__, 1, 2)));
+lzma_attribute((__format__(__printf__, 1, 2)))
+extern void message_warning(const char *fmt, ...);
/// \brief Prints an error message and sets exit status
///
/// The message is printed only if verbosity level is at least V_ERROR.
/// The exit status is set to ERROR.
-extern void message_error(const char *fmt, ...)
- lzma_attribute((__format__(__printf__, 1, 2)));
+lzma_attribute((__format__(__printf__, 1, 2)))
+extern void message_error(const char *fmt, ...);
/// \brief Prints an error message and exits with EXIT_ERROR
///
/// The message is printed only if verbosity level is at least V_ERROR.
-extern void message_fatal(const char *fmt, ...)
- lzma_attribute((__format__(__printf__, 1, 2)))
- lzma_attribute((__noreturn__));
+tuklib_attr_noreturn
+lzma_attribute((__format__(__printf__, 1, 2)))
+extern void message_fatal(const char *fmt, ...);
/// Print an error message that an internal error occurred and exit with
/// EXIT_ERROR.
-extern void message_bug(void) lzma_attribute((__noreturn__));
+tuklib_attr_noreturn
+extern void message_bug(void);
/// Print a message that establishing signal handlers failed, and exit with
/// exit status ERROR.
-extern void message_signal_handler(void) lzma_attribute((__noreturn__));
+tuklib_attr_noreturn
+extern void message_signal_handler(void);
/// Convert lzma_ret to a string.
@@ -100,11 +102,13 @@ extern void message_try_help(void);
/// Prints the version number to stdout and exits with exit status SUCCESS.
-extern void message_version(void) lzma_attribute((__noreturn__));
+tuklib_attr_noreturn
+extern void message_version(void);
/// Print the help message.
-extern void message_help(bool long_help) lzma_attribute((__noreturn__));
+tuklib_attr_noreturn
+extern void message_help(bool long_help);
/// \brief Set the total number of files to be processed