From: Thiago Becker <tbecker@redhat.com>
To: linux-nfs@vger.kernel.org
Cc: steved@redhat.com, Thiago Becker <tbecker@redhat.com>
Subject: [PATCH] nfsrahead: getopt return type is int
Date: Fri, 13 May 2022 16:18:08 -0300 [thread overview]
Message-ID: <20220513191808.2930668-1-tbecker@redhat.com> (raw)
While compiling for aarch64, the compiler throws the warning below
because char is unsigned for aarch64.
main.c: In function ‘main’:
main.c:145:48: warning: comparison is always true due to limited range of data type [-Wtype-limits]
145 | while((opt = getopt(argc, argv, "dF")) != -1) {
|
This makes nfsrahead to run forever. Fix opt type to the same as getopt
type.
Signed-off-by: Thiago Becker <tbecker@redhat.com>
---
tools/nfsrahead/main.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/tools/nfsrahead/main.c b/tools/nfsrahead/main.c
index 5fae941c..c83c6f71 100644
--- a/tools/nfsrahead/main.c
+++ b/tools/nfsrahead/main.c
@@ -135,10 +135,9 @@ static int conf_get_readahead(const char *kind) {
int main(int argc, char **argv)
{
- int ret = 0, retry;
+ int ret = 0, retry, opt;
struct device_info device;
unsigned int readahead = 128, log_level, log_stderr = 0;
- char opt;
log_level = D_ALL & ~D_GENERAL;
--
2.35.1
next reply other threads:[~2022-05-13 19:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-13 19:18 Thiago Becker [this message]
2022-05-26 17:32 ` [PATCH] nfsrahead: getopt return type is int Steve Dickson
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=20220513191808.2930668-1-tbecker@redhat.com \
--to=tbecker@redhat.com \
--cc=linux-nfs@vger.kernel.org \
--cc=steved@redhat.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;
as well as URLs for NNTP newsgroup(s).