netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH iptables] iptables: Remove const qualifier from struct option.
@ 2017-12-21  3:35 Varsha Rao
  2017-12-21  3:35 ` [PATCH iptables] extensions: Add macro _DEFAULT_SOURCE Varsha Rao
  2017-12-21  8:09 ` [PATCH iptables] iptables: Remove const qualifier from struct option Pablo Neira Ayuso
  0 siblings, 2 replies; 4+ messages in thread
From: Varsha Rao @ 2017-12-21  3:35 UTC (permalink / raw)
  To: Pablo Neira Ayuso, netfilter-devel; +Cc: 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,

Signed-off-by: Varsha Rao <rvarsha016@gmail.com>
---
 iptables/ip6tables.c | 2 +-
 iptables/iptables.c  | 2 +-
 iptables/xtables.c   | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/iptables/ip6tables.c b/iptables/ip6tables.c
index 0f6fa31a..49bd006f 100644
--- a/iptables/ip6tables.c
+++ b/iptables/ip6tables.c
@@ -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'},
diff --git a/iptables/iptables.c b/iptables/iptables.c
index e930fe26..69d19fec 100644
--- a/iptables/iptables.c
+++ b/iptables/iptables.c
@@ -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'},
diff --git a/iptables/xtables.c b/iptables/xtables.c
index aebe7d77..ac113254 100644
--- a/iptables/xtables.c
+++ b/iptables/xtables.c
@@ -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'},
-- 
2.14.3


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH iptables] extensions: Add macro _DEFAULT_SOURCE.
  2017-12-21  3:35 [PATCH iptables] iptables: Remove const qualifier from struct option Varsha Rao
@ 2017-12-21  3:35 ` Varsha Rao
  2017-12-21  8:10   ` Pablo Neira Ayuso
  2017-12-21  8:09 ` [PATCH iptables] iptables: Remove const qualifier from struct option Pablo Neira Ayuso
  1 sibling, 1 reply; 4+ messages in thread
From: Varsha Rao @ 2017-12-21  3:35 UTC (permalink / raw)
  To: Pablo Neira Ayuso, netfilter-devel; +Cc: Varsha Rao

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"

Signed-off-by: Varsha Rao <rvarsha016@gmail.com>
---
 extensions/libxt_hashlimit.c | 1 +
 extensions/libxt_limit.c     | 1 +
 2 files changed, 2 insertions(+)

diff --git a/extensions/libxt_hashlimit.c b/extensions/libxt_hashlimit.c
index e51ac1ae..ffe342a7 100644
--- a/extensions/libxt_hashlimit.c
+++ b/extensions/libxt_hashlimit.c
@@ -11,6 +11,7 @@
  * Error corections by nmalykh@bilim.com (22.01.2005)
  */
 #define _BSD_SOURCE 1
+#define _DEFAULT_SOURCE 1
 #define _ISOC99_SOURCE 1
 #include <inttypes.h>
 #include <math.h>
diff --git a/extensions/libxt_limit.c b/extensions/libxt_limit.c
index 5cc95c2e..c8ddca87 100644
--- a/extensions/libxt_limit.c
+++ b/extensions/libxt_limit.c
@@ -4,6 +4,7 @@
  * Hervé Eychenne    <rv@wallfire.org>
  */
 #define _BSD_SOURCE 1
+#define _DEFAULT_SOURCE 1
 #define _ISOC99_SOURCE 1
 #include <math.h>
 #include <stdio.h>
-- 
2.14.3


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH iptables] iptables: Remove const qualifier from struct option.
  2017-12-21  3:35 [PATCH iptables] iptables: Remove const qualifier from struct option Varsha Rao
  2017-12-21  3:35 ` [PATCH iptables] extensions: Add macro _DEFAULT_SOURCE Varsha Rao
@ 2017-12-21  8:09 ` Pablo Neira Ayuso
  1 sibling, 0 replies; 4+ messages in thread
From: Pablo Neira Ayuso @ 2017-12-21  8:09 UTC (permalink / raw)
  To: Varsha Rao; +Cc: netfilter-devel

On Thu, Dec 21, 2017 at 09:05:44AM +0530, Varsha Rao wrote:
> 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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH iptables] extensions: Add macro _DEFAULT_SOURCE.
  2017-12-21  3:35 ` [PATCH iptables] extensions: Add macro _DEFAULT_SOURCE Varsha Rao
@ 2017-12-21  8:10   ` Pablo Neira Ayuso
  0 siblings, 0 replies; 4+ messages in thread
From: Pablo Neira Ayuso @ 2017-12-21  8:10 UTC (permalink / raw)
  To: Varsha Rao; +Cc: netfilter-devel

On Thu, Dec 21, 2017 at 09:05:45AM +0530, Varsha Rao wrote:
> 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"

Also applied, thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-12-21  8:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-21  3:35 [PATCH iptables] iptables: Remove const qualifier from struct option Varsha Rao
2017-12-21  3:35 ` [PATCH iptables] extensions: Add macro _DEFAULT_SOURCE Varsha Rao
2017-12-21  8:10   ` Pablo Neira Ayuso
2017-12-21  8:09 ` [PATCH iptables] iptables: Remove const qualifier from struct option Pablo Neira Ayuso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).