qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] Re: [HaikuPorts-devs] [PATCH] trace: Adapt trace file name


From: Ingo Weinhold
Subject: [Qemu-devel] Re: [HaikuPorts-devs] [PATCH] trace: Adapt trace file name for Haiku
Date: Sat, 09 Oct 2010 23:18:04 +0200
User-agent: Beam 1.1.3

On 2010-10-09 at 21:55:17 [+0200], Andreas Färber <address@hidden> wrote:
> Resolves the following warning:
> 
>   CC    simpletrace.o
> /Data/QEMU/qemu/simpletrace.c: In function 'st_set_trace_file':
> /Data/QEMU/qemu/simpletrace.c:77: warning: format '%u' expects type 
> 'unsigned int', but argument 3 has type 'pid_t'
> 
> Cc: Stefan Hajnoczi <address@hidden>
> Cc: Blue Swirl <address@hidden>
> Signed-off-by: Andreas Färber <address@hidden>
> ---
>  configure |    6 +++++-
>  1 files changed, 5 insertions(+), 1 deletions(-)
> 
> diff --git a/configure b/configure
> index d303061..3e694a2 100755
> --- a/configure
> +++ b/configure
> @@ -2609,7 +2609,11 @@ if test "$trace_backend" = "simple"; then
>  fi
>  # Set the appropriate trace file.
>  if test "$trace_backend" = "simple"; then
> -  trace_file="\"$trace_file-%u\""
> +  if test "$haiku" = "yes"; then
> +    trace_file="\"$trace_file-%lu\""
> +  else
> +    trace_file="\"$trace_file-%u\""
> +  fi
>  fi
>  echo "CONFIG_TRACE_FILE=$trace_file" >> $config_host_mak
>  
> --
> 1.7.3

Please don't apply. The patch doesn't work for 64 bit Haiku.

According to POSIX:

  "blksize_t, pid_t, and ssize_t shall be signed integer types."

and

  "... the widths of blksize_t, pid_t, size_t, ssize_t, and suseconds_t are no 
greater 
than the width of type long"

So a safe and portable solution would be to use "%ld" and cast the pid_t to 
long.

CU, Ingo



reply via email to

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