iptables: Remove const qualifier from struct option.
PATCH 1/1 iptables: Remove const qualifier from struct option.
As opts is reassigned multiple times, it cannot be made constant. So remove const qualifier from structure option. This patch fixes the following warning:
warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
.orig_opts = original_opts,
--- iptables/ip6tables.c | 2 +- iptables/iptables.c | 2 +- iptables/xtables.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
iptables/ip6tables.c +1 -1
@@ -78,7 +78,7 @@ static const char optflags[]static const char unsupported_rev[] =" [unsupported revision]" ; -static const struct option original_opts[] = { +static struct option original_opts[] = { {.name ="append" , .has_arg =1 , .val ='A' }, {.name ="delete" , .has_arg =1 , .val ='D' }, {.name ="check" , .has_arg =1 , .val ='C' },
iptables/iptables.c +1 -1
@@ -75,7 +75,7 @@ static const char optflags[]static const char unsupported_rev[] =" [unsupported revision]" ; -static const struct option original_opts[] = { +static struct option original_opts[] = { {.name ="append" , .has_arg =1 , .val ='A' }, {.name ="delete" , .has_arg =1 , .val ='D' }, {.name ="check" , .has_arg =1 , .val ='C' },
iptables/xtables.c +1 -1
@@ -59,7 +59,7 @@ static const char cmdflags[] = { 'I', 'D', 'D', 'R', 'A', 'L', 'F', 'Z',static const char optflags[] = {'n' ,'s' ,'d' ,'p' ,'j' ,'v' ,'x' ,'i' ,'o' ,'0' ,'c' ,'f' }; -static const struct option original_opts[] = { +static struct option original_opts[] = { {.name ="append" , .has_arg =1 , .val ='A' }, {.name ="delete" , .has_arg =1 , .val ='D' }, {.name ="check" , .has_arg =1 , .val ='C' },
Signature · 1 line
2.14.3
PATCH 1/1 extensions: Add macro _DEFAULT_SOURCE.
Define _DEFAULT_SOURCE as _BSD_SOURCE is deprecated.
https://sourceware.org/glibc/wiki/Release/2.20#Packaging_Changes
This patch fixes the following warning:
warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp]
# warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use # _DEFAULT_SOURCE"
--- extensions/libxt_hashlimit.c | 1 + extensions/libxt_limit.c | 1 + 2 files changed, 2 insertions(+)
extensions/libxt_hashlimit.c +1 -0
@@ -11,6 +11,7 @@* Error corections by [email protected] (22.01.2005) */ #define _BSD_SOURCE 1 +#define _DEFAULT_SOURCE 1#define _ISOC99_SOURCE 1#include <inttypes.h> #include <math.h>
extensions/libxt_limit.c +1 -0
@@ -4,6 +4,7 @@* Hervé Eychenne <[email protected]> */ #define _BSD_SOURCE 1 +#define _DEFAULT_SOURCE 1#define _ISOC99_SOURCE 1#include <math.h> #include <stdio.h>
Signature · 1 line
2.14.3
Pablo Neira Ayuso
maintainerRe: [PATCH iptables] extensions: Add macro _DEFAULT_SOURCE.
Quoted 9 lines · Varsha Rao
Define
_DEFAULT_SOURCEas_BSD_SOURCEis deprecated.
https://sourceware.org/glibc/wiki/Release/2.20#Packaging_ChangesThis patch fixes the following warning:
warning: #warning "
_BSD_SOURCEand_SVID_SOURCEare deprecated, use_DEFAULT_SOURCE" [-Wcpp]# warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use # _DEFAULT_SOURCE"
Also applied, thanks.
Quoted 7 lines · Varsha Rao
As opts is reassigned multiple times, it cannot be made constant. So remove const qualifier from structure option. This patch fixes the following warning:
warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
.orig_opts =original_opts,
Applied, thanks Varsha.