Received: from eggs.gnu.org ([208.118.235.92]:38103) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UXuRr-0003KJ-LO for qemu-devel@nongnu.org; Thu, 02 May 2013 10:25:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UXuRn-0005Xz-0B for qemu-devel@nongnu.org; Thu, 02 May 2013 10:25:27 -0400 Received: from roura.ac.upc.es ([147.83.33.10]:56208) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UXuRm-0005Xk-Lx for qemu-devel@nongnu.org; Thu, 02 May 2013 10:25:22 -0400 From: =?utf-8?Q?Llu=C3=ADs_Vilanova?= References: <1367502325-25419-1-git-send-email-stefanha@redhat.com> Date: Thu, 02 May 2013 16:25:20 +0200 In-Reply-To: <1367502325-25419-1-git-send-email-stefanha@redhat.com> (Stefan Hajnoczi's message of "Thu, 2 May 2013 15:45:25 +0200") Message-ID: <877gjhcvcf.fsf@fimbulvetr.bsc.es> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] trace: inline control-internal.h into control.h List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: qemu-devel@nongnu.org, Andreas Faerber Stefan Hajnoczi writes: > trace/control.h is the API for manipulating trace events in QEMU. Some > of the implementation of this API lives in trace/control-internal.h. > Older versions of gcc complain because a static prototype is used but > the function is defined static inline later on: > CC vl.o > In file included from trace/control.h:191, > from vl.c:165: > trace/control.h:77: > warning: =E2=80=98trace_event_count=E2=80=99 declared inline after bein= g called > trace/control.h:77: > warning: previous declaration of =E2=80=98trace_event_count=E2=80=99 wa= s here > The gcc version is: > gcc (SUSE Linux) 4.3.4 [gcc-4_3-branch revision 152973] > The whole split into a public header and implementation header with > static inlines seems a bit much anyway. If we want these functions to > be static inline let's pay the price and put them into the header file. > Note that a few functions must be re-ordered so that they are declared > before use. Wouldn't declaring them as "static inline" solve the compiler warning? Sorr= y, but I don't have such gcc version to try it. My personal taste is that having headers only with (grouped) declarations a= nd documentation helps improving readability and in getting to know the codeba= se, but feel free to merge the files. Lluis --=20 "And it's much the same thing with knowledge, for whenever you learn something new, the whole world becomes that much richer." -- The Princess of Pure Reason, as told by Norton Juster in The Phantom Tollbooth