smalloc: fix compiler warning on Windows
authorVincent Fu <vincent.fu@wdc.com>
Wed, 31 Jul 2019 20:57:51 +0000 (16:57 -0400)
committerJens Axboe <axboe@kernel.dk>
Wed, 31 Jul 2019 21:16:39 +0000 (15:16 -0600)
firstfree() triggers a warning from the Windows compiler used by
AppVeyor because it doesn't return a value if the for loop iterates to
completion. This patch resolves the compiler warning.

AppVeyor Windows build log: https://ci.appveyor.com/project/axboe/fio/builds/26381726

Signed-off-by: Jens Axboe <axboe@kernel.dk>
smalloc.c

index c97bcbaae5bb429cfa807f32edfc4fa9d216867b..0d7054a429480a51c60d774496191ba7de193850 100644 (file)
--- a/smalloc.c
+++ b/smalloc.c
@@ -347,6 +347,9 @@ static unsigned int firstfree(struct pool *pool)
                         return i;
 
         assert(0);
+
+       /* we will never get here but this fixes a compiler warning */
+       return -1U;
 }
 
 static void *__smalloc_pool(struct pool *pool, size_t size)