Received: from eggs.gnu.org ([208.118.235.92]:46489) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TY26Y-0006yh-16 for qemu-devel@nongnu.org; Mon, 12 Nov 2012 17:03:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TY26U-0003ex-VI for qemu-devel@nongnu.org; Mon, 12 Nov 2012 17:03:41 -0500 Received: from mx1.redhat.com ([209.132.183.28]:29238) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TY26U-0003ei-MK for qemu-devel@nongnu.org; Mon, 12 Nov 2012 17:03:38 -0500 Date: Mon, 12 Nov 2012 20:04:38 -0200 From: Eduardo Habkost Message-ID: <20121112220438.GG8231@otherpad.lan.raisama.net> References: <1352473012-20500-1-git-send-email-ehabkost@redhat.com> <1352473012-20500-4-git-send-email-ehabkost@redhat.com> <50A170D6.9020408@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <50A170D6.9020408@suse.de> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 03/24] qemu-common.h: comment about usage rules List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Andreas =?iso-8859-1?Q?F=E4rber?= Cc: peter.maydell@linaro.org, riku.voipio@iki.fi, qemu-devel@nongnu.org, blauwirbel@gmail.com, Anthony Liguori , Igor Mammedov On Mon, Nov 12, 2012 at 10:57:42PM +0100, Andreas F=E4rber wrote: > Am 09.11.2012 15:56, schrieb Eduardo Habkost: > > Every time we make a tiny change on a header file, we often find > > circular header dependency problems. To avoid this nightmare, we need= to > > stop including qemu-common.h on other headers, and we should graduall= y >=20 > "from other headers" as below? Both forms sounds equivalent, to my non-native-speaker ears. :-) But I guess "including from other headers" is better. >=20 > > move the declarations from the catchall qemu-common.h header to their > > specific headers. > >=20 > > This simply adds a comment documenting the rules about qemu-common.h, > > hoping that people will see it before including qemu-common.h from ot= her > > header files, and before adding more declarations to qemu-common.h. >=20 > This reminds me that I had once posted a patch moving a declaration I > had once added for Cocoa to a new ui/ui.h... seems it never made it to > master, I'll go search, maybe we can smuggle that in now. ;) >=20 > >=20 > > Signed-off-by: Eduardo Habkost > > --- > > qemu-common.h | 11 ++++++++++- > > 1 file changed, 10 insertions(+), 1 deletion(-) > >=20 > > diff --git a/qemu-common.h b/qemu-common.h > > index ac9985c..ea43bfa 100644 > > --- a/qemu-common.h > > +++ b/qemu-common.h > > @@ -1,5 +1,14 @@ > > =20 > > -/* Common header file that is included by all of qemu. */ > > +/* Common header file that is included by all of qemu. >=20 > "QEMU", while at it. >=20 > > + * > > + * This file is supposed to be included only by .c files. No header = file should > > + * depend on qemu-common.h, as this would easily lead to circular he= ader > > + * dependencies. > > + * > > + * If a header files uses a definition from qemu-common.h, that defi= nition >=20 > "a header file" Oops. Thanks. >=20 > > + * must be moved to a separate header file, and the header that uses= it > > + * must include that header. > > + */ > > #ifndef QEMU_COMMON_H > > #define QEMU_COMMON_H > > =20 >=20 > I'll fix this up myself to spare you a resend and me another full revie= w. Thanks! >=20 > Regards, > Andreas >=20 > --=20 > SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany > GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrn= berg >=20 --=20 Eduardo