Skip to contentSkip to conversation

multipath-tools: libdmmp: Fix incorrect use of __attribute__

PATCH Applied Gris Ge 2 participants 2 messages Mar 11, 2017 – Mar 16, 2017 Device mapper

lore
Share & tools
lore

Gris Ge

author
#0 lore raw

PATCH 1/1 multipath-tools: libdmmp: Fix incorrect use of __attribute__

According to https://gcc.gnu.org/onlinedocs/gcc/Type-Attributes.html , type attributes should be placed immediately after the struct, union or enum keyword.

---
 libdmmp/libdmmp/libdmmp.h | 8 ++++----
 libdmmp/libdmmp_private.h | 3 ++-
 2 files changed, 6 insertions(+), 5 deletions(-)
libdmmp/libdmmp/libdmmp.h +4 -4
index 3fc8e6f..0679158 100644
@@ -73,18 +73,18 @@ extern "C" {
  */
 DMMP_DLL_EXPORT const char *dmmp_log_priority_str(int priority);
 
-DMMP_DLL_EXPORT struct dmmp_context;
+struct DMMP_DLL_EXPORT dmmp_context;
 
-DMMP_DLL_EXPORT struct dmmp_mpath;
+struct DMMP_DLL_EXPORT dmmp_mpath;
 
-DMMP_DLL_EXPORT struct dmmp_path_group;
+struct DMMP_DLL_EXPORT dmmp_path_group;
 
 #define DMMP_PATH_GROUP_STATUS_UNKNOWN	0
 #define DMMP_PATH_GROUP_STATUS_ENABLED	1
 #define DMMP_PATH_GROUP_STATUS_DISABLED	2
 #define DMMP_PATH_GROUP_STATUS_ACTIVE	3
 
-DMMP_DLL_EXPORT struct dmmp_path;
+struct DMMP_DLL_EXPORT dmmp_path;
 
 #define DMMP_PATH_STATUS_UNKNOWN	0
 //#define DMMP_PATH_STATUS_UNCHECKED	1
libdmmp/libdmmp_private.h +2 -1
index e23c995..3e813cb 100644
@@ -47,7 +47,8 @@ extern "C" {
 
 #define _DMMP_PATH_GROUP_ID_UNKNOWN	0
 
-DMMP_DLL_LOCAL struct _num_str_conv {
+struct DMMP_DLL_LOCAL _num_str_conv;
+struct _num_str_conv {
 	const uint32_t value;
 	const char *str;
 };
Signature · 1 line
2.12.0
#1 lore raw

Applied
Thanks.

Quoted 59 lines · Gris Ge

According to https://gcc.gnu.org/onlinedocs/gcc/Type-Attributes.html , type attributes should be placed immediately after the struct, union or enum keyword.

---
 libdmmp/libdmmp/libdmmp.h | 8 ++++----
 libdmmp/libdmmp_private.h | 3 ++-
 2 files changed, 6 insertions(+), 5 deletions(-)
libdmmp/libdmmp/libdmmp.h +4 -4
index 3fc8e6f..0679158 100644
@@ -73,18 +73,18 @@ extern "C" {
  */
 DMMP_DLL_EXPORT const char *dmmp_log_priority_str(int priority);
 
-DMMP_DLL_EXPORT struct dmmp_context;
+struct DMMP_DLL_EXPORT dmmp_context;
 
-DMMP_DLL_EXPORT struct dmmp_mpath;
+struct DMMP_DLL_EXPORT dmmp_mpath;
 
-DMMP_DLL_EXPORT struct dmmp_path_group;
+struct DMMP_DLL_EXPORT dmmp_path_group;
 
 #define DMMP_PATH_GROUP_STATUS_UNKNOWN 0
 #define DMMP_PATH_GROUP_STATUS_ENABLED 1
 #define DMMP_PATH_GROUP_STATUS_DISABLED        2
 #define DMMP_PATH_GROUP_STATUS_ACTIVE  3
 
-DMMP_DLL_EXPORT struct dmmp_path;
+struct DMMP_DLL_EXPORT dmmp_path;
 
 #define DMMP_PATH_STATUS_UNKNOWN       0
 //#define DMMP_PATH_STATUS_UNCHECKED   1
libdmmp/libdmmp_private.h +2 -2
index e23c995..3e813cb 100644
@@ -47,7 +47,8 @@ extern "C" {
 
 #define _DMMP_PATH_GROUP_ID_UNKNOWN    0
 
-DMMP_DLL_LOCAL struct _num_str_conv {
+struct DMMP_DLL_LOCAL _num_str_conv;
+struct _num_str_conv {
        const uint32_t value;
        const char *str;
 };
--

2.12.0

--
dm-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/dm-devel