All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: netfilter-devel@vger.kernel.org
Subject: [PATCH conntrackd 3/3] Fix -Wimplicit-function-declaration
Date: Thu, 24 Nov 2022 11:08:04 +0100	[thread overview]
Message-ID: <20221124100804.25674-3-pablo@netfilter.org> (raw)
In-Reply-To: <20221124100804.25674-1-pablo@netfilter.org>

From: Sam James <sam@gentoo.org>

read_config_yy.c: In function ‘yyparse’:
read_config_yy.c:1765:16: warning: implicit declaration of function ‘yylex’ [-Wimplicit-function-declaration]
 1765 |       yychar = yylex ();
      |                ^~~~~
read_config_yy.c:1765:16: warning: nested extern declaration of ‘yylex’ [-Wnested-externs]
read_config_yy.y:120:17: warning: implicit declaration of function ‘dlog’ [-Wimplicit-function-declaration]
  120 |                 dlog(LOG_ERR, "LogFile path is longer than %u characters",
      |                 ^~~~
read_config_yy.y:120:17: warning: nested extern declaration of ‘dlog’ [-Wnested-externs]
read_config_yy.y:240:14: warning: implicit declaration of function ‘inet_aton’; did you mean ‘in6_pton’? [-Wimplicit-function-declaration]
  240 |         if (!inet_aton($2, &conf.channel[conf.channel_num].u.mcast.in)) {
      |              ^~~~~~~~~
      |              in6_pton

Closes: https://bugzilla.netfilter.org/show_bug.cgi?id=1637
Signed-off-by: Sam James <sam@gentoo.org>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
posted via https://bugzilla.netfilter.org/show_bug.cgi?id=1637

 src/read_config_lex.l |  3 ++-
 src/read_config_yy.y  | 11 +++++++++++
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/src/read_config_lex.l b/src/read_config_lex.l
index 7dc400a3a9b5..27084329d185 100644
--- a/src/read_config_lex.l
+++ b/src/read_config_lex.l
@@ -21,6 +21,7 @@
 
 #include <string.h>
 
+#include "log.h"
 #include "conntrackd.h"
 #include "read_config_yy.h"
 %}
@@ -174,7 +175,7 @@ notrack		[N|n][O|o][T|t][R|r][A|a][C|c][K|k]
 %%
 
 int
-yywrap()
+yywrap(void)
 {
 	return 1;
 }
diff --git a/src/read_config_yy.y b/src/read_config_yy.y
index a2154be3733e..f06c6afff7cb 100644
--- a/src/read_config_yy.y
+++ b/src/read_config_yy.y
@@ -31,14 +31,25 @@
 #include "cidr.h"
 #include "helper.h"
 #include "stack.h"
+#include "log.h"
+
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+
 #include <sched.h>
 #include <dlfcn.h>
+
 #include <libnetfilter_conntrack/libnetfilter_conntrack.h>
 #include <libnetfilter_conntrack/libnetfilter_conntrack_tcp.h>
 
 extern char *yytext;
 extern int   yylineno;
 
+int yylex (void);
+int yyerror (char *msg);
+void yyrestart (FILE *input_file);
+
 struct ct_conf conf;
 
 static void __kernel_filter_start(void);
-- 
2.30.2


      parent reply	other threads:[~2022-11-24 10:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-24 10:08 [PATCH conntrackd 1/3] build: don't suppress various warnings Pablo Neira Ayuso
2022-11-24 10:08 ` [PATCH conntrackd 2/3] network: Fix -Wstrict-prototypes Pablo Neira Ayuso
2022-11-24 10:08 ` Pablo Neira Ayuso [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221124100804.25674-3-pablo@netfilter.org \
    --to=pablo@netfilter.org \
    --cc=netfilter-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.