From owner-freebsd-audit Mon Jul 15 11:39:26 2002 Delivered-To: freebsd-audit@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7957537B400; Mon, 15 Jul 2002 11:39:24 -0700 (PDT) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id 257C443E64; Mon, 15 Jul 2002 11:39:23 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id EAA30253; Tue, 16 Jul 2002 04:39:16 +1000 Date: Tue, 16 Jul 2002 04:42:47 +1000 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Dag-Erling Smorgrav Cc: Giorgos Keramidas , Subject: Re: bin/ln & WARNS=5 In-Reply-To: Message-ID: <20020716044123.B41571-100000@gamplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 On 15 Jul 2002, Dag-Erling Smorgrav wrote: > Bruce Evans writes: > > That would break the possibly-intentional check for snprintf() failing. > > (size_t)-1 >= sizeof(path), but !(-1 >= (int)sizeof(path)). > > Casting a value which one knows may be negative to an unsigned type is > IMHO stupid. If the check is intentional, it should be done > explicitly. Well, it is what the original code does implicitly (except on machines where size_t is smaller than int; then size_t is promoted to int instead of int to size_t). Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message