qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 04/12] compiler.h: replace QEMU_NORETURN with G_NORETURN


From: Richard Henderson
Subject: Re: [PATCH 04/12] compiler.h: replace QEMU_NORETURN with G_NORETURN
Date: Thu, 24 Feb 2022 09:31:37 -1000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0

On 2/24/22 08:36, marcandre.lureau@redhat.com wrote:
From: Marc-André Lureau <marcandre.lureau@redhat.com>

G_NORETURN was introduced in glib 2.68, fallback to G_GNUC_NORETURN in
glib-compat.

Note that this attribute must be placed before the function declaration
(bringing a bit of consistency in qemu codebase usage).

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>

For C11, G_NORETURN is a wrapper for _Noreturn.
Since we're using C11, we should just use _Noreturn.

  void xtensa_cpu_do_unaligned_access(CPUState *cpu, vaddr addr,
                                      MMUAccessType access_type, int mmu_idx,
-                                    uintptr_t retaddr) QEMU_NORETURN;
+                                    uintptr_t retaddr) G_NORETURN;

Incorrect placement. I didn't scan the whole patch; I assume that using _Noreturn will flag this up as an error.

-static void QEMU_NORETURN dump_core_and_abort(int target_sig)
+G_NORETURN static void dump_core_and_abort(int target_sig)

I guess this can go either place, but I think I prefer the scope specifier 
first.


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]