qemu-trivial
[Top][All Lists]
Advanced

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

Re: [Qemu-trivial] [Qemu-devel] [PATCH v2] add macro file for coccinelle


From: Paolo Bonzini
Subject: Re: [Qemu-trivial] [Qemu-devel] [PATCH v2] add macro file for coccinelle
Date: Tue, 8 Sep 2015 08:44:53 -0400 (EDT)

> > +/* From qemu/compiler.h */
> > +#define QEMU_GNUC_PREREQ(maj, min) 1
> > +#define QEMU_NORETURN __attribute__ ((__noreturn__))
> > +#define QEMU_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
> > +#define QEMU_SENTINEL __attribute__((sentinel))
> > +#define QEMU_ARTIFICIAL __attribute__((always_inline, artificial))
> > +#define QEMU_PACKED __attribute__((gcc_struct, packed))
> > +
> > +#define cat(x,y) x ## y
> > +#define cat2(x,y) cat(x,y)
> 
> Why not reuse glue()?

Because the duplication is already in compiler.h, which should
use glue() instead of cat2().  Separate patch IMHO, but thanks
for noticing. :-)

Paolo

> > +#define QEMU_BUILD_BUG_ON(x) \
> > + typedef char cat2(qemu_build_bug_on__,__LINE__)[(x)?-1:1]
> > __attribute__((unused));
> > +
> > +#define GCC_FMT_ATTR(n, m) __attribute__((format(gnu_printf, n, m)))
> > +
> > +#define xglue(x, y) x ## y
> > +#define glue(x, y) xglue(x, y)
> > +#define stringify(s)       tostring(s)
> > +#define tostring(s)        #s
> > +
> > +#define typeof_field(type, field) typeof(((type *)0)->field)
> > +#define type_check(t1,t2) ((t1*)0 - (t2*)0)
> > +
> [...]
> 
> Preferably with cat2() replaced by glue():
> Reviewed-by: Markus Armbruster <address@hidden>



reply via email to

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