On 09/21/2016 09:26 AM, Felipe Franciosi wrote: > > What's the best way to bring gnulib's ignore-value.h into Qemu? I'd think we > could just add to include/qemu/compiler.h something like: > > ----------------------8<---------------------- > #if QEMU_GNUC_PREREQ(3, 4) > /* From gnulib's ignore-value.h by Jim Meyering, Eric Blake and Padraig Brady > */ > # define ignore_value(x) \ > (__extension__ ({ __typeof__ (x) __x = (x); (void) __x; })) > #else > # define ignore_value(x) ((void) (x)) > #endif > ----------------------8<---------------------- > > But I'm not sure if that suffices to meet GPL's requirements.
As Dan already pointed out, gnulib's ignore_value() is available under LGPLv2+ (the full gnulib.git/lib/ignore-value.h file states GPLv3+, for ease of copying into other GPLv3 projects; but the modules/ignore-value file states what additional licenses it can be used under). Using 'gnulib-tool --lgpl=2 ignore-value' would give you the modified version; but it is probably overkill for this situation (we can skip straight to the end result instead of going through intermediate steps). Furthermore, I'm the original author of that code snippet as listed (as gnulib.git will show); where the only modification made after I wrote it was whitespace changes and the addition of __extension__, and I'm just fine with those lines being used as-is in qemu.git (there's benefits when an original author states intentions :) So copying and pasting the relevant snippet into compiler.h is indeed the way to go; in fact, you can probably get away with a comment that just says "/* From gnulib's LGPLv2+ ignore-value.h */" without having to call out particular authors. Don't bother creating any new header or worrying about copyright boilerplate changes; and you can point to this message-id in the commit message if you are worried about a paper trail; you are not violating the GPL in this instance. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature