From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K4icB-0003aG-Nn for qemu-devel@nongnu.org; Fri, 06 Jun 2008 16:32:47 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K4icA-0003YO-AH for qemu-devel@nongnu.org; Fri, 06 Jun 2008 16:32:46 -0400 Received: from [199.232.76.173] (port=59395 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K4ic9-0003Xf-9x for qemu-devel@nongnu.org; Fri, 06 Jun 2008 16:32:45 -0400 Received: from yw-out-1718.google.com ([74.125.46.158]:5306) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1K4ic9-0008KJ-5g for qemu-devel@nongnu.org; Fri, 06 Jun 2008 16:32:45 -0400 Received: by yw-out-1718.google.com with SMTP id 6so734458ywa.82 for ; Fri, 06 Jun 2008 13:32:31 -0700 (PDT) Message-ID: <48499ECB.3050105@codemonkey.ws> Date: Fri, 06 Jun 2008 15:32:11 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] Use standard header for offsetof References: <4842DE67.9090207@mail.berlios.de> <484596C2.8030908@codemonkey.ws> <4845B193.8030209@mail.berlios.de> <4845B6A4.2070301@codemonkey.ws> <484993AA.2050603@mail.berlios.de> In-Reply-To: <484993AA.2050603@mail.berlios.de> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Stefan Weil wrote: > Anthony Liguori schrieb: >> Stefan Weil wrote: >>> Anthony Liguori schrieb: >>>> >>>> I don't understand why you're adding #include to files >>>> that do not define offsetof. What's the rationale for that? >>>> >>>> Regards, >>>> >>>> Anthony Liguori >>>> >>> There were several possible ways to replace the defines for offsetof. >>> After removing the defines, I could >>> >>> 1) include stddef.h at the places where offsetof was defined formerly >> >> This seems like the most logically thing to do to me. Otherwise, >> you're unnecessarily increasing the number of #include's in C files. >> > > exec-all.h is one of these places. Adding #include there > reduces the number of #include statements > in C sources, but now all sources which need exec-all.h also include > stddef.h during compilation. > So this increases the number of included headers during a compilation. If you want to take a stab at improving the #include's in QEMU, then you should do that as a separate patch. I'll warn you though that I doubt there's a lot of people interested in that and I think there's always reservations about changing headers because it often causes subtle breakages. Don't complicate what should be a simple patch to use the standard offset of though with other clean-ups. Regards, Anthony Liguori