resolve GCC 10 compilation issues
authorBdale Garbee <bdale@gag.com>
Wed, 5 Aug 2020 19:44:18 +0000 (13:44 -0600)
committerBdale Garbee <bdale@gag.com>
Wed, 5 Aug 2020 19:44:18 +0000 (13:44 -0600)
config.c
ip.c
ipip.h
main.c
route.c

index af350b3938c5877a70863f22aae5f0becf7c1ba3..7388c1120984e63f82a6b4c70afa59a55e427b2e 100644 (file)
--- a/config.c
+++ b/config.c
@@ -21,6 +21,8 @@ static void cerr();           /* General error printer */
 static void init_config();
 static void c_interface();
 static void print_config();
+struct interface ifs[MAX_IFACES];
+int ifs_top;
 
 static int clineno;
 static int cerrflag;
diff --git a/ip.c b/ip.c
index d38b99b1ea4339d6e9d956c4ab8b2c3ace45be6a..20eec61a0458a2f43a48b4390666397199a2ee61 100644 (file)
--- a/ip.c
+++ b/ip.c
@@ -90,7 +90,8 @@ struct interface *ifp;
 struct message *m;
 {
        unsigned char buf[MAX_SIZE], *p;
-       int n, hdr_len, fromlen;
+       int n, hdr_len;
+       unsigned int fromlen;
 #ifdef LINUX
        struct iphdr *ipptr;
 #else
diff --git a/ipip.h b/ipip.h
index 9384c4b92590a82b974401bc5c8a6b426e70ba34..fed254ab3fdb5d855a064021a37edd54ba8fc2ac 100644 (file)
--- a/ipip.h
+++ b/ipip.h
 
 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
 
-int debugd;
-int debugt;
-char progname[32];
-int no_timestamp;
-int stat_interval;
+extern int debugd;
+extern int debugt;
+extern char progname[];
+extern int no_timestamp;
+extern int stat_interval;
 
 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
 
@@ -122,14 +122,14 @@ struct route {
 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
 
 #ifdef LINUX
-struct ipip_route rts[MAX_ROUTES];
+extern struct ipip_route rts[MAX_ROUTES];
 #else
 struct route rts[MAX_ROUTES];
 #endif
-int rts_top;
+extern int rts_top;
 
-struct interface ifs[MAX_IFACES];
-int ifs_top;
+extern struct interface ifs[MAX_IFACES];
+extern int ifs_top;
 
 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
 /*
diff --git a/main.c b/main.c
index 049120c1c350c10d8a0d94b33966996f135484d8..ed9e144993803b4d0032f8a526d8c1a036539b69 100644 (file)
--- a/main.c
+++ b/main.c
@@ -32,17 +32,21 @@ jmp_buf restart_env;
 static void hupper(int sig);
 jmp_buf term_env;
 static void terminator();
+int stat_interval;
+int no_timestamp;
+int debugd;
+int debugt;
 
+char progname[32];
 char *configfile, *routefile;
 int version_only;
 
-void
+int
 main(argc, argv)
        int argc;
        char *argv[];
 {
        int n, i, oops, help;
-       time_t now;
        FILE *pid_file;
 
        debugd = 0;
@@ -139,7 +143,6 @@ main(argc, argv)
 
        if(setjmp(term_env)!=0){
                send_stats(1);          /* force print of statistics */
-               now = time(NULL);
                syslog(LOG_CRIT, "exit (killed)");
                exit(0);
        }
diff --git a/route.c b/route.c
index 5c8559b71dfde4256c85c65fac3751b0d914d488..df16e48e8ad959c601fefd12a5a6e1791aa8f95d 100644 (file)
--- a/route.c
+++ b/route.c
@@ -31,6 +31,8 @@ static void sort_routes();
 
 static int rlineno;
 static int rerrflag;
+int rts_top;
+struct ipip_route rts[MAX_ROUTES];
 
 /*
  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *