All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/3] libmultipath: assign variable to make gcc happy
@ 2020-03-26  4:22 Benjamin Marzinski
  2020-03-26  4:22 ` [PATCH v2 2/3] libmutipath: don't close fd on dm_lib_release Benjamin Marzinski
  2020-03-26  4:22 ` [PATCH v2 3/3] libmultipath: allow force reload with no active paths Benjamin Marzinski
  0 siblings, 2 replies; 4+ messages in thread
From: Benjamin Marzinski @ 2020-03-26  4:22 UTC (permalink / raw)
  To: Christophe Varoqui; +Cc: device-mapper development, Martin Wilck

There is nothing wrong with is_queueing not being set at the start
of __set_no_path_retry(), it will always get set before it is accessed,
but gcc 8.2.1 is failing with

structs_vec.c: In function ‘__set_no_path_retry’:
structs_vec.c:339:7: error: ‘is_queueing’ may be used uninitialized in
this function [-Werror=maybe-uninitialized]
  bool is_queueing;
       ^~~~~~~~~~~

so, assign a value to make it happy.

Reviewed-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
 libmultipath/structs_vec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libmultipath/structs_vec.c b/libmultipath/structs_vec.c
index 3dbbaa0f..077f2e42 100644
--- a/libmultipath/structs_vec.c
+++ b/libmultipath/structs_vec.c
@@ -336,7 +336,7 @@ static void leave_recovery_mode(struct multipath *mpp)
 
 void __set_no_path_retry(struct multipath *mpp, bool check_features)
 {
-	bool is_queueing;
+	bool is_queueing = false; /* assign a value to make gcc happy */
 
 	check_features = check_features && mpp->features != NULL;
 	if (check_features)
-- 
2.17.2

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

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

end of thread, other threads:[~2020-03-26  8:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-26  4:22 [PATCH v2 1/3] libmultipath: assign variable to make gcc happy Benjamin Marzinski
2020-03-26  4:22 ` [PATCH v2 2/3] libmutipath: don't close fd on dm_lib_release Benjamin Marzinski
2020-03-26  8:41   ` Martin Wilck
2020-03-26  4:22 ` [PATCH v2 3/3] libmultipath: allow force reload with no active paths Benjamin Marzinski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.