On 01/18/2016 11:05 AM, Peter Maydell wrote:

>>> +++ b/qom/cpu.c
>>> @@ -18,6 +18,7 @@
>>>   * <http://www.gnu.org/licenses/gpl-2.0.html>
>>>   */
>>>
>>> +#include "qemu/osdep.h"
>>>  #include "qemu-common.h"
>>
>> Shouldn't qemu-common.h include osdep.h?
> 
> It does, but the intention is that every .c file should include
> qemu/osdep.h as its first include (even if some other include
> it has also results in osdep.h being pulled in).

Eventually, we want to force that NO .h file includes qemu/osdep.h.  If
every .c file includes it first, then all other .h files can count on it
already being included and therefore don't need to include it
themselves.  (This is comparable to the rule used in other projects,
like libvirt's handling of config.h which must be first in all .c files
and must not be included in .h files).

> This is a simple
> rule that's easy to check in code review and hopefully also
> in an automated way.

Indeed - we MUST turn on automation after all these individual patches
are in, to make sure we don't regress (again, something that libvirt has
already managed to do, so it shouldn't be too hard to automate, except
that libvirt's automation is courtesy of gnulib which we don't use here).

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to