Skip to content

Commit

Permalink
build: fix build warnings issued by high version gcc
Browse files Browse the repository at this point in the history
Signed-off-by: ywc689 <[email protected]>
  • Loading branch information
ywc689 committed Sep 14, 2024
1 parent 5b4e47c commit 7b4124c
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 16 deletions.
Empty file modified include/sctp/sctp.h
100755 → 100644
Empty file.
17 changes: 7 additions & 10 deletions src/dpdk.mk
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,21 @@ If dpdk has installed already, please ensure the libdpdk.pc file could be found
You may fix the problem by setting LIBDPDKPC_PATH (in file src/dpdk.mk) to the path of libdpdk.pc file explicitly
endef

# It's noted that pkg-config version 0.29.2 is recommended,
# It's noted that pkg-config version 0.29.2+ is recommended,
# pkg-config 0.27.1 would mess up the ld flags when linking dpvs.
PKGCONFIG_VERSION=$(shell pkg-config pkg-config --version)
ifneq "v$(PKGCONFIG_VERSION)" "v0.29.2"
$(warning "The pkg-config version is $(PKGCONFIG_VERSION) but 0.29.2 is recommended.")
PKGCONFIG_VERSION=$(shell pkg-config --version)
ifeq "v$(PKGCONFIG_VERSION)" "v0.27.1"
$(error "pkg-config version $(PKGCONFIG_VERSION) isn't supported by dpvs, please use 0.29.2 instead.")
endif
$(error "pkg-config version $(PKGCONFIG_VERSION) isn't supported, require 0.29.2+")
endif

ifeq ($(shell pkg-config --exists libdpdk && echo 0),0)
CFLAGS += -DALLOW_EXPERIMENTAL_API $(shell pkg-config --cflags libdpdk)
LIBS += $(shell pkg-config --static --libs libdpdk)
else
ifneq ($(wildcard $(LIBDPDKPC_PATH)),)
CFLAGS += -DALLOW_EXPERIMENTAL_API $(shell PKG_CONFIG_PATH=$(LIBDPDKPC_PATH) pkg-config --cflags libdpdk)
LIBS += $(shell PKG_CONFIG_PATH=$(LIBDPDKPC_PATH) pkg-config --static --libs libdpdk)
else
ifeq ($(shell pkg-config --exists libdpdk && echo 0),0)
CFLAGS += -DALLOW_EXPERIMENTAL_API $(shell pkg-config --cflags libdpdk)
LIBS += $(shell pkg-config --static --libs libdpdk)
else
$(error $(PKG_CONFIG_ERR_MSG))
endif
endif
2 changes: 1 addition & 1 deletion src/inetaddr.c
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ static int inet6_addr_gen_stable(struct in6_addr secret, struct inet_device *ide
uint32_t prefix[2];
struct rte_ether_addr hwaddr;
uint8_t dad_count;
} __rte_packed data;
} data;
uint8_t dad_count = 0;

memset(&data, 0, sizeof(data));
Expand Down
2 changes: 1 addition & 1 deletion tools/dpvs-agent/cmd/dpvs-agent-server/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
TARGET := dpvs-agent

GO ?= go
LD_FLAGS = -ldflags="-s -w"
LD_FLAGS = -ldflags="-s -w -X main.buildVersion=$(git rev-parse --short HEAD)"
GO_BUILD = CGO_ENABLED=0 $(GO) build $(LD_FLAGS)
GO_CLEAN = $(GO) clean
INSTALL = install
Expand Down
2 changes: 1 addition & 1 deletion tools/healthcheck/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
TARGET := healthcheck

GO ?= go
LD_FLAGS = -ldflags="-s -w"
LD_FLAGS = -ldflags="-s -w -X main.buildVersion=$(git rev-parse --short HEAD)"
GO_BUILD = CGO_ENABLED=0 $(GO) build $(LD_FLAGS)
GO_CLEAN = $(GO) clean

Expand Down
8 changes: 5 additions & 3 deletions tools/ipvsadm/ipvsadm.c
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ parse_options(int argc, char **argv, struct ipvs_command_entry *ce,
int c, parse;
poptContext context;
char *optarg= NULL;
int intarg = NULL;
int intarg = 0;
struct poptOption options_table[] = {
{ "add-service", 'A', POPT_ARG_NONE, NULL, 'A', NULL, NULL },
{ "edit-service", 'E', POPT_ARG_NONE, NULL, 'E', NULL, NULL },
Expand Down Expand Up @@ -1566,9 +1566,11 @@ static int parse_match_snat(const char *buf, dpvs_service_compat_t *dpvs_svc)
dpvs_svc->af = ip_af;
}
} else if (strcmp(key, "iif") == 0) {
snprintf(dpvs_svc->match.iifname, sizeof(dpvs_svc->match.iifname), "%s", val);
strncpy(dpvs_svc->match.iifname, val, sizeof(dpvs_svc->match.iifname) - 1);
dpvs_svc->match.iifname[sizeof(dpvs_svc->match.iifname) - 1] = '\0';
} else if (strcmp(key, "oif") == 0) {
snprintf(dpvs_svc->match.oifname, sizeof(dpvs_svc->match.oifname), "%s", val);
strncpy(dpvs_svc->match.oifname, val, sizeof(dpvs_svc->match.oifname) - 1);
dpvs_svc->match.oifname[sizeof(dpvs_svc->match.oifname) - 1] = '\0';
} else {
return -1;
}
Expand Down
1 change: 1 addition & 0 deletions tools/keepalived/keepalived/include/layer4.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ typedef struct _conn_opts {

/* Prototypes defs */
#ifdef _WITH_LVS_
extern void set_buf(char *buf, size_t buf_len);
extern enum connect_result
socket_bind_connect(int, conn_opts_t *);
#endif
Expand Down
1 change: 1 addition & 0 deletions tools/keepalived/keepalived/vrrp/vrrp_daemon.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
*/

#include "config.h"
#include "sockopt.h"

#ifdef _HAVE_SCHED_RT_
#include <sched.h>
Expand Down

0 comments on commit 7b4124c

Please sign in to comment.