From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:53790) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QRPEd-0002dd-No for qemu-devel@nongnu.org; Tue, 31 May 2011 09:43:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QRPEc-00039D-JM for qemu-devel@nongnu.org; Tue, 31 May 2011 09:43:51 -0400 Received: from mail-yi0-f45.google.com ([209.85.218.45]:61540) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QRPEc-000397-Gp for qemu-devel@nongnu.org; Tue, 31 May 2011 09:43:50 -0400 Received: by yib19 with SMTP id 19so2126134yib.4 for ; Tue, 31 May 2011 06:43:50 -0700 (PDT) Message-ID: <4DE4F094.201@codemonkey.ws> Date: Tue, 31 May 2011 08:43:48 -0500 From: Anthony Liguori MIME-Version: 1.0 References: <1305814662-16184-1-git-send-email-avi@redhat.com> <4DE2C364.6060601@codemonkey.ws> <4DE35DFD.600@redhat.com> In-Reply-To: <4DE35DFD.600@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] #include cleanliness List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity Cc: qemu-devel@nongnu.org On 05/30/2011 04:06 AM, Avi Kivity wrote: > On 05/30/2011 01:06 AM, Anthony Liguori wrote: >> On 05/19/2011 09:17 AM, Avi Kivity wrote: >>> My mother always told me to explicitly #include any headers need to >>> compile >>> a file, instead of relying on other #includes to bring them in. This >>> patch >>> fixes up targphys.h and cpu-common.h in this regard. >>> >>> Signed-off-by: Avi Kivity >>> --- >>> cpu-common.h | 4 ++++ >>> targphys.h | 2 ++ >>> 2 files changed, 6 insertions(+), 0 deletions(-) >>> >>> diff --git a/cpu-common.h b/cpu-common.h >>> index 151c32c..2009adc 100644 >>> --- a/cpu-common.h >>> +++ b/cpu-common.h >>> @@ -18,6 +18,10 @@ >>> #include "bswap.h" >>> #include "qemu-queue.h" >>> >>> +#include "qemu-common.h" >>> + >>> +#include >> >> qemu-common.h should include stdbool. >> >> The idea behind qemu-common.h is to avoid direct includes to help with >> portability. > > Okay. But note qemu-common.h #includes cpu.h #includes qemu-common.h... Fortunately, guards will prevent infinite recursion here :-) > I think osdep.h matches the "help with portability" label better, no? I don't disagree, but that's not the purpose of osdep.h today. qemu-common.h is a header file that's more or less supposed to be included by everything. It should prevent explicit #include's for system headers. Regards, Anthony Liguori