From c08401793a1f298b4d52410835b01ca9b64c313a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Thu, 24 Feb 2022 00:58:22 +0400 Subject: compiler.h: replace QEMU_WARN_UNUSED_RESULT with G_GNUC_WARN_UNUSED_RESULT MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit One less qemu-specific macro. It also helps to make some headers/units only depend on glib, and thus moved in standalone projects eventually. Signed-off-by: Marc-André Lureau Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- include/qemu-common.h | 2 +- include/qemu/compiler.h | 2 -- include/qemu/range.h | 4 ++-- 3 files changed, 3 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/qemu-common.h b/include/qemu-common.h index 9c04fa9..19e254d 100644 --- a/include/qemu-common.h +++ b/include/qemu-common.h @@ -27,7 +27,7 @@ int qemu_main(int argc, char **argv, char **envp); #endif ssize_t qemu_write_full(int fd, const void *buf, size_t count) - QEMU_WARN_UNUSED_RESULT; + G_GNUC_WARN_UNUSED_RESULT; #ifndef _WIN32 int qemu_pipe(int pipefd[2]); diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h index f2bd050..8385e47 100644 --- a/include/qemu/compiler.h +++ b/include/qemu/compiler.h @@ -19,8 +19,6 @@ #define QEMU_NORETURN __attribute__ ((__noreturn__)) -#define QEMU_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) - #define QEMU_SENTINEL __attribute__((sentinel)) #if defined(_WIN32) && (defined(__x86_64__) || defined(__i386__)) diff --git a/include/qemu/range.h b/include/qemu/range.h index f62b363..7e2b1cc 100644 --- a/include/qemu/range.h +++ b/include/qemu/range.h @@ -114,8 +114,8 @@ static inline uint64_t range_upb(Range *range) * @size may be 0. If the range would overflow, returns -ERANGE, otherwise * 0. */ -static inline int QEMU_WARN_UNUSED_RESULT range_init(Range *range, uint64_t lob, - uint64_t size) +G_GNUC_WARN_UNUSED_RESULT +static inline int range_init(Range *range, uint64_t lob, uint64_t size) { if (lob + size < lob) { return -ERANGE; -- cgit v1.1