fio: build warning fix on gcc-3.4.6-3
authorgurudas pai <gurudas.pai@oracle.com>
Mon, 22 Oct 2007 20:10:39 +0000 (22:10 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Mon, 22 Oct 2007 20:10:39 +0000 (22:10 +0200)
On gcc-3.4.6-3

 >make log.o
gcc -W -Wwrite-strings -Wall -D_GNU_SOURCE -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64 -O2 -g  -D_FORTIFY_SOURCE=2 -rdynamic  -c -o
log.o log.c
log.c: In function `read_iolog':
log.c:308: warning: int format, fio_ddir arg (arg 3)

Which corresponds to

enum fio_ddir rw;
..
..
if (sscanf(p, "%d,%llu,%u", &rw, &offset, &bytes) != 3) {

Following patch will fix the warning. This was added by commit
21bd2987dc5d82a18af485cd1e7841e94137fc0c

Thanks,
-Guru

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
log.c

diff --git a/log.c b/log.c
index 66b8f5babfe106ba3d7d1a68ab02d393d3467c22..039e74b25e77c5098631b83d1e0fbf16b26b0e27 100644 (file)
--- a/log.c
+++ b/log.c
@@ -294,7 +294,7 @@ static int read_iolog(struct thread_data *td, FILE *f)
        unsigned int bytes;
        char *str, *p;
        int reads, writes;
-       enum fio_ddir rw;
+       int rw;
 
        /*
         * Read in the read iolog and store it, reuse the infrastructure
@@ -328,7 +328,7 @@ static int read_iolog(struct thread_data *td, FILE *f)
                INIT_LIST_HEAD(&ipo->list);
                ipo->offset = offset;
                ipo->len = bytes;
-               ipo->ddir = rw;
+               ipo->ddir = (enum fio_ddir) rw;
                if (bytes > td->o.max_bs[rw])
                        td->o.max_bs[rw] = bytes;
                list_add_tail(&ipo->list, &td->io_log_list);