From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33373) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eyXzb-00066H-SO for qemu-devel@nongnu.org; Wed, 21 Mar 2018 03:17:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eyXza-00061y-N7 for qemu-devel@nongnu.org; Wed, 21 Mar 2018 03:17:03 -0400 References: <1521510562-529051-1-git-send-email-mst@redhat.com> <8f06e1e3-4823-d8e8-43bd-c092c523849e@vivier.eu> <20180320135548-mutt-send-email-mst@kernel.org> From: Thomas Huth Message-ID: <459fa95d-8f0a-22fa-80fb-4af22ccf49b3@redhat.com> Date: Wed, 21 Mar 2018 08:16:00 +0100 MIME-Version: 1.0 In-Reply-To: <20180320135548-mutt-send-email-mst@kernel.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH] qemu: include generated files with <> and not "" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" , Laurent Vivier Cc: Peter Maydell , Dmitry Fleytman , sheepdog@lists.wpkg.org, Ronnie Sahlberg , Li Zhijian , David Hildenbrand , Jeff Cody , Zhang Chen , qemu-devel@nongnu.org, BALATON Zoltan , Keith Busch , Max Filippov , Gerd Hoffmann , Jiri Pirko , Subbaraya Sundeep , Eric Blake , Michael Roth , Marcelo Tosatti , Josh Durgin , Stefano Stabellini , Alberto Garcia , zhanghailiang , Ben Warren , Marcel Apfelbaum , Yongbok Kim , Markus Armbruster , Stefan Berger , Christian Borntraeger , kvm@vger.kernel.org, =?UTF-8?Q?Herv=c3=a9_Poussineau?= , Shannon Zhao , Anthony Perard , Liu Yuan , David Gibson , Andrzej Zaborowski , Jason Wang , Artyom Tarasenko , Riku Voipio , Fam Zheng , Eduardo Habkost , Corey Minyard , Amit Shah , Pavel Dovgalyuk , Stefan Weil , Xie Changlong , Alistair Francis , Peter Lieven , "Dr. David Alan Gilbert" , Greg Kurz , =?UTF-8?Q?Marc-Andr=c3=a9_Lureau?= , Alex Williamson , qemu-arm@nongnu.org, Peter Chubb , Yuval Shaia , Stefan Hajnoczi , Paolo Bonzini , xen-devel@lists.xenproject.org, John Snow , Richard Henderson , Kevin Wolf , "=?UTF-8?Q?Daniel_P._Berrang=c3=a9?=" , qemu-block@nongnu.org, Peter Crosthwaite , Hitoshi Mitake , Wen Congyang , qemu-s390x@nongnu.org, Cornelia Huck , "Richard W.M. Jones" , Juan Quintela , Max Reitz , Michael Walle , qemu-ppc@nongnu.org, =?UTF-8?Q?Andreas_F=c3=a4rber?= , Igor Mammedov , Hannes Reinecke , =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= On 20.03.2018 13:05, Michael S. Tsirkin wrote: > On Tue, Mar 20, 2018 at 09:58:23AM +0100, Laurent Vivier wrote: >> Le 20/03/2018 =C3=A0 02:54, Michael S. Tsirkin a =C3=A9crit=C2=A0: >>> QEMU coding style at the moment asks for all non-system >>> include files to be used with #include "foo.h". >>> However this rule actually does not make sense and >>> creates issues for when the included file is generated. >> >> If you change that, we can have issue when a system include has the sa= me >> name as our local include. With "", system header are taken firs= t. >=20 > Are you sure? I just tested and that is not the case with > either gcc or clang. >=20 >>> In C, include "file" means look in current directory, >>> then on include search path. Current directory here >>> means the source file directory. >>> By comparison include means look on include search path. >> >> Not exactly, there is the notion of "system header" too. >> >> https://gcc.gnu.org/onlinedocs/cpp/Include-Syntax.html >> >> #include >> This variant is used for system header files. It searches for a file >> named file in a standard list of system directories. You can prepend >> directories to this list with the -I option (see Invocation). >=20 > This is exactly what we do. >=20 >> #include "file" >> This variant is used for header files of your own program. It searches >> for a file named file first in the directory containing the current >> file, then in the quote directories and then the same directories used >> for . You can prepend directories to the list of quote directori= es >> with the -iquote option. >=20 > Since we do not use -iquote, "" just adds the current directory. So why don't we simply switch to use -iquote instead of -I for adding search paths for our own headers? We then would get a clean separation of QEMU headers from system headers. Thomas