From 72cbcae7afdcce2def0fc26704409c79c1b02a00 Mon Sep 17 00:00:00 2001 From: Boris Gjenero Date: Sun, 1 Nov 2020 17:33:33 -0500 Subject: [PATCH] Fix errors and simple warnings when building on GCC 10.2.0. --- Makefile | 2 +- common/device.c | 2 +- common/file.c | 4 +++- common/get.c | 1 + common/loop-bsd.c | 2 +- mopchk/mopchk.c | 3 ++- mopd/mopd.c | 7 +------ mopd/process.c | 1 + mopprobe/mopprobe.c | 4 +++- moptrace/moptrace.c | 3 ++- 10 files changed, 16 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index 1987dcd..884ba46 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ AR = ar CC = gcc RANLIB = ranlib -CFLAGS = -O2 -g +CFLAGS = -O2 -g -Wno-endif-labels LDFLAGS = LIBELF = -lelf diff --git a/common/device.c b/common/device.c index 2707334..e2388ae 100644 --- a/common/device.c +++ b/common/device.c @@ -31,6 +31,7 @@ static char rcsid[] = "$Id: device.c,v 1.21 1996/08/08 00:00:59 moj Exp $"; #endif +#include #include "os.h" #include "common.h" #include "mopdef.h" @@ -48,7 +49,6 @@ int mopOpenDL(struct if_info *, int); int mopOpenRC(struct if_info *, int); #endif int pfTrans(); -int pfInit(); int pfWrite(); #ifdef DEV_NEW_CONF diff --git a/common/file.c b/common/file.c index fa6938f..a5c603a 100644 --- a/common/file.c +++ b/common/file.c @@ -73,7 +73,7 @@ static char rcsid[] = "$Id: file.c,v 1.4 1996/08/16 22:39:22 moj Exp $"; #endif #ifndef NOELF -#include +#include #endif struct mopphdr { @@ -582,6 +582,7 @@ GetAOutFileInfo(fd, load, xfr, ftype, seg) ex.a_drsize= mopFileGetBX((u_char *)&ex_swap, 28, 4); break; default: + break; /*###525 [cc] syntax error before `}'%%%*/ } @@ -635,6 +636,7 @@ GetAOutFileInfo(fd, load, xfr, ftype, seg) break; #endif default: + break; } printf(") Magic: "); switch (N_GETMAGIC (ex)) { diff --git a/common/get.c b/common/get.c index b9f5fac..6204aa8 100644 --- a/common/get.c +++ b/common/get.c @@ -31,6 +31,7 @@ static char rcsid[] = "$Id: get.c,v 1.5 1996/03/31 18:50:14 moj Exp $"; #endif +#include #include #include #include "mopdef.h" diff --git a/common/loop-bsd.c b/common/loop-bsd.c index f0929d0..193d752 100644 --- a/common/loop-bsd.c +++ b/common/loop-bsd.c @@ -91,7 +91,7 @@ mopReadDL() * The list of all interfaces that are being listened to. loop() * "selects" on the descriptors in this list. */ -struct if_info *iflist; +extern struct if_info *iflist; void mopProcess __P((struct if_info *, u_char *)); diff --git a/mopchk/mopchk.c b/mopchk/mopchk.c index aafa7aa..65e7cdb 100644 --- a/mopchk/mopchk.c +++ b/mopchk/mopchk.c @@ -37,6 +37,7 @@ static char rcsid[] = "$Id: mopchk.c,v 1.5 1996/08/16 22:46:55 moj Exp $"; * Usage: mopchk [-a] [-v] [filename...] */ +#include #include #include #include @@ -48,7 +49,7 @@ static char rcsid[] = "$Id: mopchk.c,v 1.5 1996/08/16 22:46:55 moj Exp $"; * The list of all interfaces that are being listened to. rarp_loop() * "selects" on the descriptors in this list. */ -struct if_info *iflist; +extern struct if_info *iflist; #ifdef NO__P void Usage (/* void */); diff --git a/mopd/mopd.c b/mopd/mopd.c index 9252c79..44bf094 100644 --- a/mopd/mopd.c +++ b/mopd/mopd.c @@ -38,6 +38,7 @@ static char rcsid[] = "$Id: mopd.c,v 1.14 1996/03/31 19:20:42 moj Exp $"; * mopd [ -d -f -v ] [ -3 | -4 ] interface */ +#include #include #include #include @@ -50,12 +51,6 @@ static char rcsid[] = "$Id: mopd.c,v 1.14 1996/03/31 19:20:42 moj Exp $"; #include #include "process.h" -/* - * The list of all interfaces that are being listened to. - * "selects" on the descriptors in this list. - */ -struct if_info *iflist; - #ifdef NO__P void Loop (/* void */); void Usage (/* void */); diff --git a/mopd/process.c b/mopd/process.c index 848bbe8..ffb9e54 100644 --- a/mopd/process.c +++ b/mopd/process.c @@ -31,6 +31,7 @@ static char rcsid[] = "$Id: process.c,v 1.21 1996/08/22 17:04:07 moj Exp $"; #endif +#include #include #include #include diff --git a/mopprobe/mopprobe.c b/mopprobe/mopprobe.c index c3e0873..d87bc86 100644 --- a/mopprobe/mopprobe.c +++ b/mopprobe/mopprobe.c @@ -38,6 +38,8 @@ static char rcsid[] = "$Id: mopprobe.c,v 1.11 1996/08/11 22:16:10 moj Exp $"; * mopprobe [ -3 | -4 ] interface */ +#include +#include #include #include #include @@ -52,7 +54,7 @@ static char rcsid[] = "$Id: mopprobe.c,v 1.11 1996/08/11 22:16:10 moj Exp $"; * The list of all interfaces that are being listened to. rarp_loop() * "selects" on the descriptors in this list. */ -struct if_info *iflist; +extern struct if_info *iflist; #ifdef NO__P void Loop (/* void */); diff --git a/moptrace/moptrace.c b/moptrace/moptrace.c index 406aa44..7630cbf 100644 --- a/moptrace/moptrace.c +++ b/moptrace/moptrace.c @@ -38,6 +38,7 @@ static char rcsid[] = "$Id: moptrace.c,v 1.10 1996/08/05 07:49:14 moj Exp $"; * moptrace [ -d ] [ -3 | -4 ] interface */ +#include #include #include #include @@ -52,7 +53,7 @@ static char rcsid[] = "$Id: moptrace.c,v 1.10 1996/08/05 07:49:14 moj Exp $"; * The list of all interfaces that are being listened to. * "selects" on the descriptors in this list. */ -struct if_info *iflist; +extern struct if_info *iflist; #ifdef NO__P void Loop (/* void */);