* [Qemu-devel] [PATCH] trace: Fix build warnings for Win32 build
@ 2014-02-20 19:44 Peter Maydell
2014-02-20 21:41 ` Stefan Weil
2014-02-21 10:07 ` Stefan Hajnoczi
0 siblings, 2 replies; 3+ messages in thread
From: Peter Maydell @ 2014-02-20 19:44 UTC (permalink / raw)
To: qemu-devel; +Cc: Stefan Weil, Stefan Hajnoczi, patches
The Win32 build warns about trace/control-internal.h:
warning: 'trace_event_count' declared inline after being called
Fix this by simply reordering trace_event_id() and
trace_event_count().
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
trace/control-internal.h | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/trace/control-internal.h b/trace/control-internal.h
index cce2da4..b3f587e 100644
--- a/trace/control-internal.h
+++ b/trace/control-internal.h
@@ -16,15 +16,15 @@
extern TraceEvent trace_events[];
-static inline TraceEvent *trace_event_id(TraceEventID id)
+static inline TraceEventID trace_event_count(void)
{
- assert(id < trace_event_count());
- return &trace_events[id];
+ return TRACE_EVENT_COUNT;
}
-static inline TraceEventID trace_event_count(void)
+static inline TraceEvent *trace_event_id(TraceEventID id)
{
- return TRACE_EVENT_COUNT;
+ assert(id < trace_event_count());
+ return &trace_events[id];
}
static inline bool trace_event_is_pattern(const char *str)
--
1.8.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] trace: Fix build warnings for Win32 build
2014-02-20 19:44 [Qemu-devel] [PATCH] trace: Fix build warnings for Win32 build Peter Maydell
@ 2014-02-20 21:41 ` Stefan Weil
2014-02-21 10:07 ` Stefan Hajnoczi
1 sibling, 0 replies; 3+ messages in thread
From: Stefan Weil @ 2014-02-20 21:41 UTC (permalink / raw)
To: Peter Maydell, qemu-devel; +Cc: Stefan Hajnoczi, patches
Am 20.02.2014 20:44, schrieb Peter Maydell:
> The Win32 build warns about trace/control-internal.h:
>
> warning: 'trace_event_count' declared inline after being called
>
> Fix this by simply reordering trace_event_id() and
> trace_event_count().
>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> trace/control-internal.h | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
Reviewed-by: Stefan Weil <sw@weilnetz.de>
This is not OS specific, but depends on the compiler. MinGW-w64 uses a
newer gcc which does not complain. Reordering the two function is
reasonable nevertheless.
Regards
Stefan
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] trace: Fix build warnings for Win32 build
2014-02-20 19:44 [Qemu-devel] [PATCH] trace: Fix build warnings for Win32 build Peter Maydell
2014-02-20 21:41 ` Stefan Weil
@ 2014-02-21 10:07 ` Stefan Hajnoczi
1 sibling, 0 replies; 3+ messages in thread
From: Stefan Hajnoczi @ 2014-02-21 10:07 UTC (permalink / raw)
To: Peter Maydell; +Cc: Stefan Weil, qemu-devel, patches
On Thu, Feb 20, 2014 at 07:44:25PM +0000, Peter Maydell wrote:
> The Win32 build warns about trace/control-internal.h:
>
> warning: 'trace_event_count' declared inline after being called
>
> Fix this by simply reordering trace_event_id() and
> trace_event_count().
>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> trace/control-internal.h | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
Thanks, applied to my tracing tree:
https://github.com/stefanha/qemu/commits/tracing
Stefan
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-02-21 10:07 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-20 19:44 [Qemu-devel] [PATCH] trace: Fix build warnings for Win32 build Peter Maydell
2014-02-20 21:41 ` Stefan Weil
2014-02-21 10:07 ` Stefan Hajnoczi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).