From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56448) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eyLOu-0004Gd-Lt for qemu-devel@nongnu.org; Tue, 20 Mar 2018 13:50:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eyLOs-0001Oq-Sg for qemu-devel@nongnu.org; Tue, 20 Mar 2018 13:50:20 -0400 Date: Tue, 20 Mar 2018 19:49:41 +0200 From: "Michael S. Tsirkin" Message-ID: <20180320194454-mutt-send-email-mst@kernel.org> References: <1521510562-529051-1-git-send-email-mst@redhat.com> <20180320185130-mutt-send-email-mst@kernel.org> <20180320173401.GG4530@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20180320173401.GG4530@redhat.com> Content-Transfer-Encoding: quoted-printable 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: Daniel =?iso-8859-1?Q?P=2E_Berrang=E9?= Cc: Stefan Weil , Peter Maydell , Dmitry Fleytman , sheepdog@lists.wpkg.org, Pavel Dovgalyuk , Li Zhijian , David Hildenbrand , Jeff Cody , Mark Cave-Ayland , qemu-devel@nongnu.org, Alexander Graf , Markus Armbruster , Keith Busch , Max Filippov , Hannes Reinecke , Gerd Hoffmann , "Edgar E. Iglesias" , Max Reitz , Yongbok Kim , Josh Durgin , Stefano Stabellini , Alberto Garcia , zhanghailiang , Ben Warren , Stefan Berger , Ronnie Sahlberg , Michael Roth , "Richard W.M. Jones" , Christian Borntraeger , =?iso-8859-1?Q?Herv=E9?= Poussineau , =?iso-8859-1?Q?Marc-Andr=E9?= Lureau , Shannon Zhao , Marcel Apfelbaum , Liu Yuan , Richard Henderson , Jason Wang , Artyom Tarasenko , Alistair Francis , Jiri Pirko , Eduardo Habkost , Corey Minyard , Amit Shah , Xie Changlong , Riku Voipio , Peter Lieven , "Dr. David Alan Gilbert" , Fabien Chouteau , Greg Kurz , Anthony Perard , Alex Williamson , qemu-arm@nongnu.org, Peter Chubb , Yuval Shaia , Stefan Hajnoczi , Zhang Chen , xen-devel@lists.xenproject.org, John Snow , Fam Zheng , David Gibson , Kevin Wolf , kvm@vger.kernel.org, qemu-block@nongnu.org, Peter Crosthwaite , Hitoshi Mitake , Wen Congyang , qemu-s390x@nongnu.org, Marcelo Tosatti , Laurent Vivier , Juan Quintela , Subbaraya Sundeep , Michael Walle , Igor Mammedov , qemu-ppc@nongnu.org, Cornelia Huck , Paolo Bonzini , Andreas =?iso-8859-1?Q?F=E4rber?= , Aurelien Jarno , Philippe =?iso-8859-1?Q?Mathieu-Daud=E9?= On Tue, Mar 20, 2018 at 05:34:01PM +0000, Daniel P. Berrang=C3=A9 wrote: > On Tue, Mar 20, 2018 at 07:10:42PM +0200, Michael S. Tsirkin wrote: > > On Tue, Mar 20, 2018 at 05:33:42PM +0100, Stefan Weil wrote: > > > Using <> for system include files and "" for local include files is= a > > > convention, and as far as I know most projects adhere to that > > > convention. So does QEMU currently. Such conventions are not only > > > important for humans, but also for tools. There are more tools than= the > > > C preprocessor which handle <> and "" differently. For example the = GNU > > > compiler uses -MD or -MMD to automatically generate dependency rule= s for > > > make. While -MD generates dependencies to all include files, -MMD d= oes > > > so only for user include files, but not for system include files. "= user" > > > and "system" means the different forms how include statements are > > > written. QEMU still seems to use -MMD: > > >=20 > > > rules.mak:QEMU_DGFLAGS +=3D -MMD -MP -MT $@ -MF $(@D)/$(*F).d > >=20 > > To my knowledge, and according to my limited testing, > > system headers in this context means > > the default ones not supplied with -I. >=20 > GCC's definition of system header is here: >=20 > https://gcc.gnu.org/onlinedocs/cpp/System-Headers.html >=20 >=20 > Regards, > Daniel Proves my point, does it not? You will note that it does not refer to include <> anywhere. 2.8 System Headers The header files declaring interfaces to the operating system and run= time libraries often cannot be written in strictly conforming C. Therefor= e, GCC gives code found in system headers special treatment. All warnings= , other than those generated by =E2=80=98#warning=E2=80=99 (see Diagnosti= cs), are suppressed while GCC is processing a system header. Macros defin= ed in a system header are immune to a few warnings wherever they are expa= nded. This immunity is granted on an ad-hoc basis, when we find that a wa= rning generates lots of false positives because of code in macros defined= in system headers. Normally, only the headers found in specific directories are consider= ed system headers. These directories are determined when GCC is compiled.= There are, however, two ways to make normal headers into system headers: Header files found in directories added to the search path with the -= isystem and -idirafter command-line options are treated as system headers= for the purposes of diagnostics. There is also a directive, #pragma GCC system_header, which tells GCC= to consider the rest of the current include file a system header, no mat= ter where it was found. Code that comes before the =E2=80=98#pragma=E2=80= =99 in the file is not affected. #pragma GCC system_header has no effect = in the primary source file. Conclusion: #include <> is ignored for purposes of determining whether a = header is a system one or not. > --=20 > |: https://berrange.com -o- https://www.flickr.com/photos/dberr= ange :| > |: https://libvirt.org -o- https://fstop138.berrange= .com :| > |: https://entangle-photo.org -o- https://www.instagram.com/dberr= ange :|