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

2015-09-15 Thread Michael Tokarev
07.09.2015 13:21, Paolo Bonzini wrote: > Coccinelle chokes on some idioms from compiler.h and queue.h. > Extract those in a macro file, to be used with "--macro-file > scripts/cocci-macro-file.h". Applied to -trivial, thank you! /mjt

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

2015-09-10 Thread John Snow
On 09/09/2015 05:51 AM, Paolo Bonzini wrote: > > > On 08/09/2015 20:35, Markus Armbruster wrote: Having not used Coccinelle yet, what happens if any of these functions become desynchronized ? >> Coccinelle transforms C to C. Problem: if you parse C the normal way >> (first run prepro

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

2015-09-09 Thread Paolo Bonzini
On 08/09/2015 20:35, Markus Armbruster wrote: >> > Having not used Coccinelle yet, what happens if any of these functions >> > become desynchronized ? > Coccinelle transforms C to C. Problem: if you parse C the normal way > (first run preprocessor, then the parser proper), you have to unparse >

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

2015-09-08 Thread Markus Armbruster
John Snow writes: > On 09/07/2015 06:21 AM, Paolo Bonzini wrote: >> Coccinelle chokes on some idioms from compiler.h and queue.h. >> Extract those in a macro file, to be used with "--macro-file >> scripts/cocci-macro-file.h". >> >> Signed-off-by: Paolo Bonzini >> --- >> scripts/cocci-macro-fil

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

2015-09-08 Thread John Snow
On 09/07/2015 06:21 AM, Paolo Bonzini wrote: > Coccinelle chokes on some idioms from compiler.h and queue.h. > Extract those in a macro file, to be used with "--macro-file > scripts/cocci-macro-file.h". > > Signed-off-by: Paolo Bonzini > --- > scripts/cocci-macro-file.h | 119 > ++

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

2015-09-08 Thread Markus Armbruster
Paolo Bonzini writes: >> > +/* 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)) >> > +#defin

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

2015-09-08 Thread Paolo Bonzini
> > +/* 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_

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

2015-09-08 Thread Markus Armbruster
Paolo Bonzini writes: > Coccinelle chokes on some idioms from compiler.h and queue.h. > Extract those in a macro file, to be used with "--macro-file > scripts/cocci-macro-file.h". > > Signed-off-by: Paolo Bonzini I tested this as follows. Coccinelle can report on its parsing difficulties: $ s

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

2015-09-07 Thread Paolo Bonzini
Coccinelle chokes on some idioms from compiler.h and queue.h. Extract those in a macro file, to be used with "--macro-file scripts/cocci-macro-file.h". Signed-off-by: Paolo Bonzini --- scripts/cocci-macro-file.h | 119 + 1 file changed, 119 insertions(