Hi On Thu, Feb 24, 2022 at 11:37 PM Richard Henderson < richard.hender...@linaro.org> wrote:
> On 2/24/22 08:36, marcandre.lur...@redhat.com wrote: > > From: Marc-André Lureau <marcandre.lur...@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.lur...@redhat.com> > > For C11, G_NORETURN is a wrapper for _Noreturn. > Since we're using C11, we should just use _Noreturn. > G_NORETURN has several flavours, one of them is the c++ [[noreturn]], but also MSVC specific etc. Might be worth considering if we think about making code usable in different contexts. > > > 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. > Right, bad regexp search, will fix. > > > -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. > Ok, I'll change it to "static G_NORETURN" -- Marc-André Lureau