@@ -269,6 +269,23 @@ endif()
RDMA_AddOptCFlag(CMAKE_C_FLAGS HAVE_C_WSTRICT_PROTOTYPES "-Wstrict-prototypes")
RDMA_AddOptCFlag(CMAKE_C_FLAGS HAVE_C_WOLD_STYLE_DEFINITION "-Wold-style-definition")
+# Old versions of libnl have a duplicated rtnl_route_put, disbale the warning on those
+# systems
+if (NOT NL_KIND EQUAL 0)
+ set(SAFE_CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES}")
+ set(SAFE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
+ set(CMAKE_REQUIRED_INCLUDES "${NL_INCLUDE_DIRS}")
+ set(CMAKE_REQUIRED_FLAGS "-Wredundant-decls")
+ CHECK_C_SOURCE_COMPILES("
+ #include <netlink/route/route.h>
+ int main(int argc,const char *argv[]) { return 0; }"
+ HAVE_C_WREDUNDANT_DECLS
+ FAIL_REGEX "warning")
+ set(CMAKE_REQUIRED_INCLUDES "${SAFE_CMAKE_REQUIRED_INCLUDES}")
+ set(CMAKE_REQUIRED_FLAGS "${SAFE_CMAKE_REQUIRED_FLAGS}")
+endif()
+RDMA_AddOptCFlag(CMAKE_C_FLAGS HAVE_C_WREDUNDANT_DECLS "-Wredundant-decls")
+
#-------------------------
# Build Prep
# Write out a git ignore file to the build directory if it isn't the source
@@ -354,3 +371,6 @@ endif()
if (NOT HAVE_C_WORKING_MISSING_FIELD_INITIALIZERS)
message(STATUS " -Wmissing-field-initializers does NOT work")
endif()
+if (NOT HAVE_C_WREDUNDANT_DECLS)
+ message(STATUS " -Wredundant-decls does NOT work")
+endif()
@@ -31,17 +31,17 @@
#define ACM_IF_H
#include <infiniband/verbs.h>
+#include <infiniband/acm_prov.h>
#ifdef ACME_PRINTS
+#undef acm_log
#define acm_log(level, format, ...) \
printf(format, ## __VA_ARGS__)
#else /* !ACME_PRINTS */
#define acm_log(level, format, ...) \
acm_write(level, "%s: "format, __func__, ## __VA_ARGS__)
-
-void acm_write(int level, const char *format, ...);
#endif /* ACME_PRINTS */
int acm_if_is_ib(char *ifname);
@@ -36,9 +36,6 @@ extern unsigned int if_nametoindex(__const char *__ifname) __THROW;
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) < (b) ? (a) : (b))
-/* Workaround - declaration missing */
-extern int rtnl_link_vlan_get_id(struct rtnl_link *);
-
#ifndef HAVE_LIBNL1
#include <netlink/route/link/vlan.h>
#endif
@@ -132,8 +132,6 @@ struct config_entry {
static struct config_entry *config;
static int config_cnt;
-extern char *program_invocation_short_name;
-
static void free_config(void)
{
@@ -85,12 +85,6 @@ struct mlx4_xsrq_table {
int mask;
};
-void mlx4_init_xsrq_table(struct mlx4_xsrq_table *xsrq_table, int size);
-struct mlx4_srq *mlx4_find_xsrq(struct mlx4_xsrq_table *xsrq_table, uint32_t srqn);
-int mlx4_store_xsrq(struct mlx4_xsrq_table *xsrq_table, uint32_t srqn,
- struct mlx4_srq *srq);
-void mlx4_clear_xsrq(struct mlx4_xsrq_table *xsrq_table, uint32_t srqn);
-
enum {
MLX4_XRC_QPN_BIT = (1 << 23)
};
This is useful to detect possible confusion/mistakes around function prototypes. Old libnl includes such a mistake so this warning is only turned on with new distros. Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com> --- CMakeLists.txt | 20 ++++++++++++++++++++ ibacm/src/acm_util.h | 4 ++-- libibverbs/neigh.c | 3 --- librdmacm/preload.c | 2 -- providers/mlx4/mlx4.h | 6 ------ 5 files changed, 22 insertions(+), 13 deletions(-)