[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] trace: inline control-internal.h into control.h

From: Lluís Vilanova
Subject: Re: [Qemu-devel] [PATCH] trace: inline control-internal.h into control.h
Date: Thu, 02 May 2013 16:25:20 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

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: ‘trace_event_count’ declared inline after being called
>                    trace/control.h:77:
>   warning: previous declaration of ‘trace_event_count’ was 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? Sorry,
but I don't have such gcc version to try it.

My personal taste is that having headers only with (grouped) declarations and
documentation helps improving readability and in getting to know the codebase,
but feel free to merge the files.


 "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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]