From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43543) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WKoAc-0008Jq-4v for qemu-devel@nongnu.org; Tue, 04 Mar 2014 07:10:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WKoAW-0001Np-6o for qemu-devel@nongnu.org; Tue, 04 Mar 2014 07:10:02 -0500 Received: from mx1.redhat.com ([209.132.183.28]:15557) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WKoAV-0001Ni-VJ for qemu-devel@nongnu.org; Tue, 04 Mar 2014 07:09:56 -0500 Message-ID: <5315C28D.2070801@redhat.com> Date: Tue, 04 Mar 2014 13:09:49 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1393901250-3922-1-git-send-email-xbing6@gmail.com> <1393901250-3922-3-git-send-email-xbing6@gmail.com> <5315A89F.40700@redhat.com> <5315C0C1.5030800@gmail.com> In-Reply-To: <5315C0C1.5030800@gmail.com> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [Discussion 02/10] NEED_CPU_H: remove '#include "cpu.h"' from include/qemu-common.h List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Xuebing wang , qemu-devel@nongnu.org Cc: afaerber@suse.de, stefanha@redhat.com Il 04/03/2014 13:02, Xuebing wang ha scritto: >> >> Of these, vl.c and linux-user/elfload.c should not include >> disas/disas.h at all, and hw/core/loader.c is !NEED_CPU_H. So there >> are just two files where you can add a #include "cpu.h" manually. >> > > My idea is to keep disas/disas.h correct just by itself, regardless how > it's used by *.c files. In general, it's a good idea to make headers self-contained by recursively including whatever's necessary. However, there are a few very central headers that are just too complicated to make self-consistent without introducing circular references. In particular, for QEMU these are qemu-common.h and cpu.h (and also others, such as exec-all.h but perhaps the solution there is to split them). It's much simpler to ask people to include these two files in the C files. Paolo