dm-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: lixiaokeng <lixiaokeng@huawei.com>
To: Martin Wilck <mwilck@suse.com>,
	Benjamin Marzinski <bmarzins@redhat.com>,
	 Christophe Varoqui <christophe.varoqui@opensvc.com>,
	dm-devel mailing list <dm-devel@redhat.com>
Cc: linfeilong <linfeilong@huawei.com>,
	"liuzhiqiang \(I\)" <liuzhiqiang26@huawei.com>
Subject: [dm-devel] [PATCH] libmultipath: fix compile error with glibc-2.34+
Date: Wed, 11 Aug 2021 21:11:43 +0800	[thread overview]
Message-ID: <30798fdf-a112-ff8c-73ac-a37a87b99bd0@huawei.com> (raw)

There is an error when complie with glibc-2.34:
comparison of integer expressions of different signedness:
'size_t' {aka 'long unsigned int'} and 'long int'
[-Werror=sign-compare]

The reason is that PTHREAD_STACK_MIN may be defined
long int which is  signed in glibc-2.34+. Explicitly assign
it to the size_t variable to  fix it.

Signed-off-by: Lixiaokeng <lixiaokeng@huawei.com>
Signed-off-by: Zhiqiang Liu <liuzhiqiang26@huawei.com>
---
 libmultipath/util.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/libmultipath/util.c b/libmultipath/util.c
index 0e37f3ff..5c2fd5c6 100644
--- a/libmultipath/util.c
+++ b/libmultipath/util.c
@@ -220,11 +220,12 @@ void
 setup_thread_attr(pthread_attr_t *attr, size_t stacksize, int detached)
 {
 	int ret;
+	size_t pthread_stack_min = PTHREAD_STACK_MIN;

 	ret = pthread_attr_init(attr);
 	assert(ret == 0);
-	if (stacksize < PTHREAD_STACK_MIN)
-		stacksize = PTHREAD_STACK_MIN;
+	if (stacksize < pthread_stack_min)
+		stacksize = pthread_stack_min;
 	ret = pthread_attr_setstacksize(attr, stacksize);
 	assert(ret == 0);
 	if (detached) {
-- 

--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel


             reply	other threads:[~2021-08-11 13:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-11 13:11 lixiaokeng [this message]
2021-08-12 11:17 ` [dm-devel] [PATCH] libmultipath: fix compile error with glibc-2.34+ Martin Wilck
2021-08-12 12:45   ` lixiaokeng

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=30798fdf-a112-ff8c-73ac-a37a87b99bd0@huawei.com \
    --to=lixiaokeng@huawei.com \
    --cc=bmarzins@redhat.com \
    --cc=christophe.varoqui@opensvc.com \
    --cc=dm-devel@redhat.com \
    --cc=linfeilong@huawei.com \
    --cc=liuzhiqiang26@huawei.com \
    --cc=mwilck@suse.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).