[Pkg-ofed-commits] [libfabric] 33/123: sockets: avoid empty "if" body in macro expansion

Ana Beatriz Guerrero López ana at moszumanska.debian.org
Sat Oct 22 12:28:27 UTC 2016


This is an automated email from the git hooks/post-receive script.

ana pushed a commit to annotated tag v1.1.1
in repository libfabric.

commit 62e65325ffcd26ea063f80aa3aa93603717e0914
Author: Dave Goodell <dgoodell at cisco.com>
Date:   Mon Aug 24 17:54:16 2015 -0700

    sockets: avoid empty "if" body in macro expansion
    
    This prevents this warning from GCC with certain flags (or sometimes
    certain versions):
    ```
    warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
    ```
    
    Signed-off-by: Dave Goodell <dgoodell at cisco.com>
---
 include/rdma/fi_log.h        | 3 ++-
 prov/sockets/src/sock_util.h | 4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/include/rdma/fi_log.h b/include/rdma/fi_log.h
index 9590d38..a817a2d 100644
--- a/include/rdma/fi_log.h
+++ b/include/rdma/fi_log.h
@@ -89,7 +89,8 @@ void fi_log(const struct fi_provider *prov, enum fi_log_level level,
 #define FI_DBG(prov, subsystem, ...)					\
 	FI_LOG(prov, FI_LOG_DEBUG, subsystem, __VA_ARGS__)
 #else
-#define FI_DBG(prov_name, subsystem, ...)
+#define FI_DBG(prov_name, subsystem, ...)				\
+	do {} while (0)
 #endif
 
 #ifdef __cplusplus
diff --git a/prov/sockets/src/sock_util.h b/prov/sockets/src/sock_util.h
index b801cde..b019752 100644
--- a/prov/sockets/src/sock_util.h
+++ b/prov/sockets/src/sock_util.h
@@ -46,8 +46,8 @@ extern int sock_pe_waittime;
 extern int sock_dgram_drop_rate;
 #endif
 
-#define _SOCK_LOG_DBG(subsys, ...) FI_DBG(&sock_prov, subsys, __VA_ARGS__);
-#define _SOCK_LOG_ERROR(subsys, ...) FI_WARN(&sock_prov, subsys, __VA_ARGS__);
+#define _SOCK_LOG_DBG(subsys, ...) FI_DBG(&sock_prov, subsys, __VA_ARGS__)
+#define _SOCK_LOG_ERROR(subsys, ...) FI_WARN(&sock_prov, subsys, __VA_ARGS__)
 
 static inline int sock_drop_packet(struct sock_ep *sock_ep)
 {	

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ofed/libfabric.git



More information about the Pkg-ofed-commits mailing list