From owner-freebsd-audit Sat Jun 8 18:14:32 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 9130837B400 for ; Sat, 8 Jun 2002 18:14:27 -0700 (PDT) Received: from hades.hell.gr (patr530-a091.otenet.gr [212.205.215.91]) by mailsrv.otenet.gr (8.12.3/8.12.3) with ESMTP id g591ENZN028615 for ; Sun, 9 Jun 2002 04:14:25 +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 g591EMUP070546 for ; Sun, 9 Jun 2002 04:14:22 +0300 (EEST) (envelope-from keramida@FreeBSD.org) Received: (from charon@localhost) by hades.hell.gr (8.12.3/8.12.3/Submit) id g591EKuI070545 for audit@FreeBSD.org; Sun, 9 Jun 2002 04:14:21 +0300 (EEST) (envelope-from keramida@FreeBSD.org) Date: Sun, 9 Jun 2002 04:14:19 +0300 From: Giorgos Keramidas To: audit@FreeBSD.org Subject: badsect warns Message-ID: <20020609011418.GA70449@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 The following enables compiling badsect with WARNS=6. There seems to be something funny about fs->fs_size though. In it's not daddr_t but `long'. This is why it triggers the warning now that the cast to `unsigned' (which is there since revision 1.1 of badsect.c) doesn't match the signed type of fs->fs_size. Is there some reason that this is cast to `unsigned'? If not, should we remove the cast and start building badsect with something more strict than WARNS=0? - Giorgos %%% Index: Makefile =================================================================== RCS file: /home/ncvs/src/sbin/badsect/Makefile,v retrieving revision 1.5 diff -u -r1.5 Makefile --- Makefile 4 Dec 2001 02:19:44 -0000 1.5 +++ Makefile 8 Jun 2002 23:55:54 -0000 @@ -2,7 +2,7 @@ # $FreeBSD: src/sbin/badsect/Makefile,v 1.5 2001/12/04 02:19:44 obrien Exp $ PROG= badsect -WARNS= 0 +WARNS= 6 MAN= badsect.8 .include Index: badsect.c =================================================================== RCS file: /home/ncvs/src/sbin/badsect/badsect.c,v retrieving revision 1.13 diff -u -r1.13 badsect.c --- badsect.c 16 May 2002 04:09:51 -0000 1.13 +++ badsect.c 9 Jun 2002 01:00:54 -0000 @@ -168,7 +168,7 @@ daddr_t fsbn, bn; fsbn = dbtofsb(fs, blkno); - if ((unsigned)(fsbn+cnt) > fs->fs_size) { + if ((fsbn + cnt) > fs->fs_size) { printf("block %ld out of range of filesystem\n", (long)blkno); return (1); } %%% To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message