Skip to contentSkip to conversation

libmultipath: fix compilation with -fno-common

PATCH In review [email protected] 2 participants 2 messages Jan 16, 2020 – Jan 21, 2020 Device mapper

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libmultipath: fix compilation with -fno-common

From: Martin Wilck <[email protected]>

This never-used variable must be declared extern in order to avoid a link stage error with -fno-common.

---
 libmultipath/structs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
libmultipath/structs.h +1 -1
index a3adf906..4bb567d3 100644
@@ -106,7 +106,7 @@ enum yes_no_undef_states {
  * _FIND_MULTIPATHS_F must have the same value as YNU_YES.
  * Generate a compile time error if that isn't the case.
  */
-char ___error1___[-(_FIND_MULTIPATHS_F != YNU_YES)];
+extern char ___error1___[-(_FIND_MULTIPATHS_F != YNU_YES)];
 
 #define find_multipaths_on(conf) \
 	(!!((conf)->find_multipaths & _FIND_MULTIPATHS_F))
Signature · 1 line
2.24.1
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 1 line · On Thu, Jan 16, 2020 at 10:55:14PM +0100, [email protected] wrote:

From: Martin Wilck <[email protected]>

Quoted 22 lines

This never-used variable must be declared extern in order to avoid a link stage error with -fno-common.

---
 libmultipath/structs.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
libmultipath/structs.h +1 -1
index a3adf906..4bb567d3 100644
@@ -106,7 +106,7 @@ enum yes_no_undef_states {
  * _FIND_MULTIPATHS_F must have the same value as YNU_YES.
  * Generate a compile time error if that isn't the case.
  */
-char ___error1___[-(_FIND_MULTIPATHS_F != YNU_YES)];
+extern char ___error1___[-(_FIND_MULTIPATHS_F != YNU_YES)];
 
 #define find_multipaths_on(conf) \
 	(!!((conf)->find_multipaths & _FIND_MULTIPATHS_F))
Signature · 1 line
2.24.1