Add uninitialized_var() to silence bogus compiler warnings
authorJens Axboe <jens.axboe@oracle.com>
Fri, 13 Jun 2008 08:27:05 +0000 (10:27 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Fri, 13 Jun 2008 08:27:05 +0000 (10:27 +0200)
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
compiler/compiler.h
engines/splice.c
io_u.c

index 72e84197584e1aa8872e2905bc70710989443416..1a0556bd3a0808c1c54bec23b85fd5e10cd22abc 100644 (file)
@@ -13,4 +13,6 @@
 #define __must_check
 #endif
 
+#define uninitialized_var(x) x = x
+
 #endif
index 03bc7ffcbc12d37e1360c05c5fefc9a132254f93..a847f9caaf7d5ca35cf08d9cadca59a50345d5bc 100644 (file)
@@ -201,7 +201,7 @@ static int fio_splice_write(struct thread_data *td, struct io_u *io_u)
 static int fio_spliceio_queue(struct thread_data *td, struct io_u *io_u)
 {
        struct spliceio_data *sd = td->io_ops->data;
-       int ret;
+       int uninitialized_var(ret);
 
        fio_ro_check(td, io_u);
 
diff --git a/io_u.c b/io_u.c
index 0d24b189fece6ee48d11e4f3bf493af271f2731e..1dff88f1edf64a5a10d9ea296ee1f5ae51e72288 100644 (file)
--- a/io_u.c
+++ b/io_u.c
@@ -235,7 +235,7 @@ static inline int is_power_of_2(unsigned int val)
 static unsigned int get_next_buflen(struct thread_data *td, struct io_u *io_u)
 {
        const int ddir = io_u->ddir;
-       unsigned int buflen = buflen; /* silence dumb gcc warning */
+       unsigned int uninitialized_var(buflen);
        unsigned int minbs, maxbs;
        long r;