xfs
[Top] [All Lists]

Re: [PATCH 4/8] xfstests: fix printf format warnings in aio-stress.c

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: [PATCH 4/8] xfstests: fix printf format warnings in aio-stress.c
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Wed, 20 Jan 2010 03:30:18 -0500
Cc: xfs@xxxxxxxxxxx
In-reply-to: <1263958688-435-5-git-send-email-david@xxxxxxxxxxxxx>
References: <1263958688-435-1-git-send-email-david@xxxxxxxxxxxxx> <1263958688-435-5-git-send-email-david@xxxxxxxxxxxxx>
User-agent: Mutt/1.5.19 (2009-01-05)
> diff --git a/ltp/aio-stress.c b/ltp/aio-stress.c
> index ab9e006..57a2158 100644
> --- a/ltp/aio-stress.c
> +++ b/ltp/aio-stress.c
> @@ -1167,9 +1167,9 @@ restart:
>  
>      if (t->stage_mb_trans && t->num_files > 0) {
>          double seconds = time_since_now(&stage_time);
> -     fprintf(stderr, "thread %d %s totals (%.2f MB/s) %.2f MB in %.2fs\n", 
> -             t - global_thread_info, this_stage, t->stage_mb_trans/seconds, 
> -             t->stage_mb_trans, seconds);
> +     fprintf(stderr, "thread %llu %s totals (%.2f MB/s) %.2f MB in %.2fs\n",
> +             (unsigned long long)(t - global_thread_info), this_stage,
> +             t->stage_mb_trans/seconds, t->stage_mb_trans, seconds);

Differences between two pointers in C99 is a ptrdiff_t.  Probably not
worth searching the printf sepcifier for it and just casting it up, so
ok.


Reviewed-by: Christoph Hellwig <hch@xxxxxx>

<Prev in Thread] Current Thread [Next in Thread>