From owner-freebsd-audit Sun Jun 9 18: 0: 1 2002 Delivered-To: freebsd-audit@freebsd.org Received: from mailsrv.otenet.gr (mailsrv.otenet.gr [195.170.0.5]) by hub.freebsd.org (Postfix) with ESMTP id 98E5837B401 for ; Sun, 9 Jun 2002 17:59:40 -0700 (PDT) Received: from hades.hell.gr (patr530-b143.otenet.gr [212.205.244.151]) by mailsrv.otenet.gr (8.12.3/8.12.3) with ESMTP id g5A0xKZN020690 for ; Mon, 10 Jun 2002 03:59:29 +0300 (EEST) Received: from hades.hell.gr (hades [127.0.0.1]) by hades.hell.gr (8.12.3/8.12.3) with ESMTP id g5A0xDTn016916 for ; Mon, 10 Jun 2002 03:59:14 +0300 (EEST) (envelope-from keramida@FreeBSD.org) Received: (from charon@localhost) by hades.hell.gr (8.12.3/8.12.3/Submit) id g5A0nFwh012024 for audit@freebsd.org; Mon, 10 Jun 2002 03:49:15 +0300 (EEST) (envelope-from keramida@FreeBSD.org) Date: Mon, 10 Jun 2002 03:49:14 +0300 From: Giorgos Keramidas To: audit@FreeBSD.org Subject: Compiling bin/ed with WARNS=6 Message-ID: <20020610004914.GA10811@hades.hell.gr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG There are only two small changes that need to be done to ed(1) to make it compile cleanly with WARNS=6 in i386/CURRENT. I have tested the following changes by doing: $ cd src/bin/ed $ make WARNS=6 cleandir all $ ./ed -x /tmp/foo Enter key: foobar123 $ /bin/ed -x /tmp/foo Enter key: foobar123 How does it look? %%% Declare an array of bytes as `char[]' and not `unsigned char[]'. Move two `extern' declarations outside of a function body. This enables ed to build with WARNS=6. Index: ed/Makefile =================================================================== RCS file: /home/ncvs/src/bin/ed/Makefile,v retrieving revision 1.21 diff -u -r1.21 Makefile --- ed/Makefile 6 Dec 2001 10:50:23 -0000 1.21 +++ ed/Makefile 9 Jun 2002 04:53:26 -0000 @@ -2,6 +2,7 @@ PROG= ed SRCS= buf.c cbc.c glbl.c io.c main.c re.c sub.c undo.c +WARNS= 6 LINKS= ${BINDIR}/ed ${BINDIR}/red MLINKS= ed.1 red.1 Index: ed/cbc.c =================================================================== RCS file: /home/ncvs/src/bin/ed/cbc.c,v retrieving revision 1.15 diff -u -r1.15 cbc.c --- ed/cbc.c 2 Feb 2002 06:36:49 -0000 1.15 +++ ed/cbc.c 9 Jun 2002 04:51:14 -0000 @@ -95,7 +95,7 @@ }; int pflag; /* 1 to preserve parity bits */ -unsigned char des_buf[8]; /* shared buffer for get_des_char/put_des_char */ +char des_buf[8]; /* shared buffer for get_des_char/put_des_char */ int des_ct = 0; /* count for get_des_char/put_des_char */ int des_n = 0; /* index for put_des_char/get_des_char */ Index: ed/main.c =================================================================== RCS file: /home/ncvs/src/bin/ed/main.c,v retrieving revision 1.22 diff -u -r1.22 main.c --- ed/main.c 2 Feb 2002 06:36:49 -0000 1.22 +++ ed/main.c 9 Jun 2002 04:48:27 -0000 @@ -444,14 +444,14 @@ long rows = 22; /* scroll length: ws_row - 2 */ +extern long u_current_addr; +extern long u_addr_last; + /* exec_command: execute the next command in command buffer; return print request, if any */ int exec_command(void) { - extern long u_current_addr; - extern long u_addr_last; - static pattern_t *pat = NULL; static int sgflag = 0; static long sgnum = 0; %%% - Giorgos To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message