Flexible I/O Tester development
 help / color / mirror / Atom feed
From: vincentfu@gmail.com
To: axboe@kernel.dk, fio@vger.kernel.org
Cc: Vincent Fu <vincent.fu@wdc.com>
Subject: [PATCH] smalloc: fix compiler warning
Date: Wed, 31 Jul 2019 16:57:51 -0400	[thread overview]
Message-ID: <20190731205751.17531-1-vincentfu@gmail.com> (raw)

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



             reply	other threads:[~2019-07-31 20:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-31 20:57 vincentfu [this message]
2019-07-31 21:17 ` [PATCH] smalloc: fix compiler warning Jens Axboe
2019-07-31 21:28 ` Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190731205751.17531-1-vincentfu@gmail.com \
    --to=vincentfu@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=fio@vger.kernel.org \
    --cc=vincent.fu@wdc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox