From 4aceda56d6dcfd7ce5deb38f65e60710a3035baa Mon Sep 17 00:00:00 2001 From: Xael South Date: Tue, 26 Jan 2021 12:36:34 +0100 Subject: [PATCH] Fix warnings for g++ 7.5.0 --- Makefile | 5 ++++- net_support.h | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 2d2d103..add4c9b 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ STRIP=strip OUTDIR?=build OUTFILE="$(OUTDIR)/rtl_wmbus" CFLAGS?=-Iinclude -std=gnu99 -CFLAGS_WARNINGS?=-Wall -W -Waggregate-return -Wbad-function-cast -Wcast-align -Wcast-qual -Wchar-subscripts -Wcomment -Wfloat-equal -Winline -Wmain -Wmissing-noreturn -Wmissing-prototypes -Wparentheses -Wpointer-arith -Wredundant-decls -Wreturn-type -Wshadow -Wsign-compare -Wstrict-prototypes -Wswitch -Wunreachable-code -Wunused -Wuninitialized +CFLAGS_WARNINGS?=-Wall -W -Waggregate-return -Wbad-function-cast -Wcast-align -Wcast-qual -Wchar-subscripts -Wcomment -Wno-float-equal -Winline -Wmain -Wmissing-noreturn -Wno-missing-prototypes -Wparentheses -Wpointer-arith -Wredundant-decls -Wreturn-type -Wshadow -Wsign-compare -Wstrict-prototypes -Wswitch -Wunreachable-code -Wunused -Wuninitialized LIB?=-lm SRC=rtl_wmbus.c @@ -27,5 +27,8 @@ pi1: rebuild: clean all +install: release + cp $(OUTFILE) /usr/bin + clean: $(RM) -rf "$(OUTDIR)" diff --git a/net_support.h b/net_support.h index 18a5127..9b6c5e7 100644 --- a/net_support.h +++ b/net_support.h @@ -14,7 +14,7 @@ FILE * get_net(const char *hostname, int port); FILE * get_net(const char *hostname, int port) { - struct sockaddr_in address = {.sin_family = AF_INET, .sin_port = htons(port)}; + struct sockaddr_in address = {.sin_family = AF_INET, .sin_port = htons(port), .sin_addr = {} }; if (-1 == inet_aton(hostname, &address.sin_addr)) { fprintf(stderr, "inet_aton() error\n");