From owner-freebsd-audit Fri Jun 1 23:40:47 2001 Delivered-To: freebsd-audit@freebsd.org Received: from bazooka.unixfreak.org (bazooka.unixfreak.org [63.198.170.138]) by hub.freebsd.org (Postfix) with ESMTP id 04C6837B423 for ; Fri, 1 Jun 2001 23:40:45 -0700 (PDT) (envelope-from dima@unixfreak.org) Received: from hornet.unixfreak.org (hornet [63.198.170.140]) by bazooka.unixfreak.org (Postfix) with ESMTP id AD9263E32 for ; Fri, 1 Jun 2001 23:40:44 -0700 (PDT) To: audit@freebsd.org Subject: cut(1) WARNS patch Date: Fri, 01 Jun 2001 23:40:44 -0700 From: Dima Dorfman Message-Id: <20010602064044.AD9263E32@bazooka.unixfreak.org> 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 Attached is a patch which silences the remaining warnings for cut(1). It's rather trivial, but I'd like someone to confirm that the first change is correct. 'stop' is a size_t, which is long on the Alpha but int on the i386. The fix below to print it using %ld and cast it to long seems to be logically correct (and it works). Thanks in advance, Dima Dorfman dima@unixfreak.org Index: cut.c =================================================================== RCS file: /stl/src/FreeBSD/src/usr.bin/cut/cut.c,v retrieving revision 1.13 diff -u -r1.13 cut.c --- cut.c 2001/04/25 05:42:53 1.13 +++ cut.c 2001/06/02 06:37:39 @@ -172,8 +172,8 @@ if (!stop || !start) errx(1, "[-cf] list: values may not include zero"); if (stop > _POSIX2_LINE_MAX) - errx(1, "[-cf] list: %d too large (max %d)", - stop, _POSIX2_LINE_MAX); + errx(1, "[-cf] list: %ld too large (max %d)", + (long)stop, _POSIX2_LINE_MAX); if (maxval < stop) maxval = stop; for (pos = positions + start; start++ <= stop; *pos++ = 1); @@ -223,7 +223,7 @@ void f_cut(fp, fname) FILE *fp; - const char *fname; + const char *fname __unused; { int ch, field, isdelim; char *pos, *p, sep; To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message