From 3a2b15af4ca3161ffa6113108835fad2e7af6161 Mon Sep 17 00:00:00 2001 From: Thomas Bernard Date: Sat, 15 Oct 2022 13:09:36 +0200 Subject: [PATCH] miniupnpd: fix warnings when compiling with IGD_V2 disabled fixes #617 ./upnpdescgen.c:946:1: warning: unused label 'unstack' [-Wunused-label] unstack: ^~~~~~~~ ./upnpdescgen.c:891:12: warning: unused parameter 'force_igd1' [-Wunused-parameter] int force_igd1) ^ ./upnpdescgen.c:1035:61: warning: unused parameter 'force_igd1' [-Wunused-parameter] genServiceDesc(int * len, const struct serviceDesc * s, int force_igd1) ^ 3 warnings generated. --- miniupnpd/upnpdescgen.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/miniupnpd/upnpdescgen.c b/miniupnpd/upnpdescgen.c index b1987c3..9840b82 100644 --- a/miniupnpd/upnpdescgen.c +++ b/miniupnpd/upnpdescgen.c @@ -900,6 +900,10 @@ genXML(char * str, int * len, int * tmplen, unsigned short j; const char * eltname; } pile[GENXML_STACK_SIZE]; /* stack */ +#if !defined(IGD_V2) + UNUSED(force_igd1); +#endif + top = -1; i = 0; /* current node */ j = 1; /* i + number of nodes*/ @@ -943,7 +947,9 @@ genXML(char * str, int * len, int * tmplen, str = strcat_str(str, len, tmplen, eltname); str = strcat_char(str, len, tmplen, '>'); } +#ifdef IGD_V2 unstack: +#endif for(;;) { if(top < 0) @@ -1040,6 +1046,10 @@ genServiceDesc(int * len, const struct serviceDesc * s, int force_igd1) const struct argument * args; char * str; int tmplen; +#if !defined(IGD_V2) + UNUSED(force_igd1); +#endif + tmplen = 2048; str = (char *)malloc(tmplen); if(str == NULL)