Flexible I/O Tester development
 help / color / mirror / Atom feed
* [PATCH] smalloc: fix compiler warning
@ 2019-07-31 20:57 vincentfu
  2019-07-31 21:17 ` Jens Axboe
  2019-07-31 21:28 ` Jens Axboe
  0 siblings, 2 replies; 3+ messages in thread
From: vincentfu @ 2019-07-31 20:57 UTC (permalink / raw)
  To: axboe, fio; +Cc: Vincent Fu

From: Vincent Fu <vincent.fu@wdc.com>

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
---
 smalloc.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/smalloc.c b/smalloc.c
index c97bcbaa..0d7054a4 100644
--- 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)
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-07-31 21:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-31 20:57 [PATCH] smalloc: fix compiler warning vincentfu
2019-07-31 21:17 ` Jens Axboe
2019-07-31 21:28 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox