From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38184) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eyHjB-0004vD-M0 for qemu-devel@nongnu.org; Tue, 20 Mar 2018 09:55:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eyHjA-0004O4-LS for qemu-devel@nongnu.org; Tue, 20 Mar 2018 09:55:01 -0400 References: <1521510562-529051-1-git-send-email-mst@redhat.com> <8f06e1e3-4823-d8e8-43bd-c092c523849e@vivier.eu> <20180320094406.GD4530@redhat.com> <20180320141107-mutt-send-email-mst@kernel.org> <20180320121841.GN4530@redhat.com> <20180320142756-mutt-send-email-mst@kernel.org> <20180320123900.GO4530@redhat.com> <20180320133216.u4hdijttdnyjbfpu@sirius.home.kraxel.org> <20180320134117.GS4530@redhat.com> From: Max Reitz Message-ID: <8e14f681-6572-062b-c503-c5ad091793d7@redhat.com> Date: Tue, 20 Mar 2018 14:54:37 +0100 MIME-Version: 1.0 In-Reply-To: <20180320134117.GS4530@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="3bVcvjt7gGf3BwAy0eGre8GNjlP4mR8zE" Subject: Re: [Qemu-devel] [PATCH] qemu: include generated files with <> and not "" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "=?UTF-8?Q?Daniel_P._Berrang=c3=a9?=" , Gerd Hoffmann Cc: "Michael S. Tsirkin" , Laurent Vivier , qemu-devel@nongnu.org, Paolo Bonzini , Peter Crosthwaite , Richard Henderson , Eduardo Habkost , Igor Mammedov , Kevin Wolf , Jeff Cody , Fam Zheng , John Snow , Stefan Weil , Stefan Hajnoczi , Ronnie Sahlberg , Peter Lieven , Eric Blake , Markus Armbruster , Alberto Garcia , Josh Durgin , Hitoshi Mitake , Liu Yuan , "Richard W.M. Jones" , =?UTF-8?Q?Marc-Andr=c3=a9_Lureau?= , "Dr. David Alan Gilbert" , Greg Kurz , Ben Warren , Peter Maydell , Shannon Zhao , Michael Walle , Keith Busch , Stefano Stabellini , Anthony Perard , Fabien Chouteau , Amit Shah , Marcel Apfelbaum , Mark Cave-Ayland , BALATON Zoltan , Alexander Graf , Cornelia Huck , Christian Borntraeger , David Gibson , Corey Minyard , =?UTF-8?Q?Herv=c3=a9_Poussineau?= , Peter Chubb , Subbaraya Sundeep , Dmitry Fleytman , Jason Wang , Yongbok Kim , Max Filippov , Jiri Pirko , Yuval Shaia , David Hildenbrand , Hannes Reinecke , =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= , Andrzej Zaborowski , Artyom Tarasenko , Alistair Francis , "Edgar E. Iglesias" , Stefan Berger , Alex Williamson , zhanghailiang , Juan Quintela , Michael Roth , =?UTF-8?Q?Andreas_F=c3=a4rber?= , Pavel Dovgalyuk , Riku Voipio , Zhang Chen , Li Zhijian , Wen Congyang , Xie Changlong , Marcelo Tosatti , Aurelien Jarno , kvm@vger.kernel.org, qemu-block@nongnu.org, sheepdog@lists.wpkg.org, qemu-arm@nongnu.org, xen-devel@lists.xenproject.org, qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, Thomas Huth This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --3bVcvjt7gGf3BwAy0eGre8GNjlP4mR8zE From: Max Reitz To: =?UTF-8?Q?Daniel_P._Berrang=c3=a9?= , Gerd Hoffmann Cc: "Michael S. Tsirkin" , Laurent Vivier , qemu-devel@nongnu.org, Paolo Bonzini , Peter Crosthwaite , Richard Henderson , Eduardo Habkost , Igor Mammedov , Kevin Wolf , Jeff Cody , Fam Zheng , John Snow , Stefan Weil , Stefan Hajnoczi , Ronnie Sahlberg , Peter Lieven , Eric Blake , Markus Armbruster , Alberto Garcia , Josh Durgin , Hitoshi Mitake , Liu Yuan , "Richard W.M. Jones" , =?UTF-8?Q?Marc-Andr=c3=a9_Lureau?= , "Dr. David Alan Gilbert" , Greg Kurz , Ben Warren , Peter Maydell , Shannon Zhao , Michael Walle , Keith Busch , Stefano Stabellini , Anthony Perard , Fabien Chouteau , Amit Shah , Marcel Apfelbaum , Mark Cave-Ayland , BALATON Zoltan , Alexander Graf , Cornelia Huck , Christian Borntraeger , David Gibson , Corey Minyard , =?UTF-8?Q?Herv=c3=a9_Poussineau?= , Peter Chubb , Subbaraya Sundeep , Dmitry Fleytman , Jason Wang , Yongbok Kim , Max Filippov , Jiri Pirko , Yuval Shaia , David Hildenbrand , Hannes Reinecke , =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= , Andrzej Zaborowski , Artyom Tarasenko , Alistair Francis , "Edgar E. Iglesias" , Stefan Berger , Alex Williamson , zhanghailiang , Juan Quintela , Michael Roth , =?UTF-8?Q?Andreas_F=c3=a4rber?= , Pavel Dovgalyuk , Riku Voipio , Zhang Chen , Li Zhijian , Wen Congyang , Xie Changlong , Marcelo Tosatti , Aurelien Jarno , kvm@vger.kernel.org, qemu-block@nongnu.org, sheepdog@lists.wpkg.org, qemu-arm@nongnu.org, xen-devel@lists.xenproject.org, qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, Thomas Huth Message-ID: <8e14f681-6572-062b-c503-c5ad091793d7@redhat.com> Subject: Re: [PATCH] qemu: include generated files with <> and not "" References: <1521510562-529051-1-git-send-email-mst@redhat.com> <8f06e1e3-4823-d8e8-43bd-c092c523849e@vivier.eu> <20180320094406.GD4530@redhat.com> <20180320141107-mutt-send-email-mst@kernel.org> <20180320121841.GN4530@redhat.com> <20180320142756-mutt-send-email-mst@kernel.org> <20180320123900.GO4530@redhat.com> <20180320133216.u4hdijttdnyjbfpu@sirius.home.kraxel.org> <20180320134117.GS4530@redhat.com> In-Reply-To: <20180320134117.GS4530@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2018-03-20 14:41, Daniel P. Berrang=C3=A9 wrote: > On Tue, Mar 20, 2018 at 02:32:16PM +0100, Gerd Hoffmann wrote: >> Hi, >> >>>> So for these, we should use "". None of these are generated files t= hough. >>> >>> That leads to crazy inconsistent message for developers where 50% of = QEMU >>> header files must use <> and the other 50% of header files must use "= ". >> >> The rules are pretty simple though: >> >> (1) Headers which are generated use <>. >> (2) Headers which are in include/ use <>. >> (3) Headers sitting in the same directory as the source files use "= ". >=20 > We have 1200 header files in QEMU - a developer might just reasonably r= emember > which header file is a QEMU header, vs which is a 3rd party system head= er. > Expecting devs to remember which of those 3 buckets each QEMU header fa= lls > under is unreasonable IMHO.=20 I agree with this in principle, but I don't find it unreasonable for someone to look up whether a header file exists in the same directory. I find that much simpler than to look up whether it is a system header, actually. And I have to agree with Michael that his rule when to use "" (if the file is in the same directory) and when to use <> (otherwise) is actually what every C developer might do by instinct. (I guess it's also easier to check in a script than the original guideline?) However, I also think that if any problem arises because "" was used for a generated file and that then uses a stale file, the bug is somewhere else. And I think that while Michael's proposal is the more intuitive (C) way, it is a tiny bit more complicated to explain than 'Use "" for qemu headers, <> for everything else'. But I guess the main advantage with using this rule I see is that it's better for people reading the code. It's just nice to know whether a file belongs to qemu or not by just looking at the #include statement. (Note that this implies that it is indeed more difficult to determine whether a header belongs to qemu than whether it sits in the same directory as the C file, though!) So I think the old (current) rule is better for reading code, Michael's rule would be better for writing code. I think reading code is what should be easier. But since that may be eaten up by build breakages due to stale files, I don't have a strong opinion either way. I just wanted to chime in because in my opinion 'Use "" for headers in the same directory, <> for everything else' is by no means an unreasonably complicated rule for people writing code. Max --3bVcvjt7gGf3BwAy0eGre8GNjlP4mR8zE Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQFGBAEBCAAwFiEEkb62CjDbPohX0Rgp9AfbAGHVz0AFAlqxEp0SHG1yZWl0ekBy ZWRoYXQuY29tAAoJEPQH2wBh1c9AJsUIAJd2GeUBJFTYmeKR5uxkvBIkRHGgRyAm H76Sk1MnAhHTVPGKLoMDwweaSnCz+XAFo3P3YJJbFSNvaWUd3ZN8roiyOlPtYnNY 6cBk9GrLnzWW8VYmEkCP4xmA0Hkowm+IKD374TBqc17h3Fzxs1obPQJxhJ8xKpvH dc10DJ6la/R+dyQAe8lTVBg5zXh44Q2zoslSvLVVE1PDcWlo+fIHai7eB5kzYyu3 jSKqdAoJvDD7d/FRndl37+Yb6AcbgUZP3U/7ntRE7Omk471b7FcoqN03GtlY0Unk hxi0sjM6SAsgGtjEm0Jiqypwlq+luCn5ekS1JI7U+/4Lo2KC5EOLD6o= =wiAH -----END PGP SIGNATURE----- --3bVcvjt7gGf3BwAy0eGre8GNjlP4mR8zE--