From owner-freebsd-audit Mon Jun 4 0:22:56 2001 Delivered-To: freebsd-audit@freebsd.org Received: from axl.seasidesoftware.co.za (cpt-dial-196-30-179-36.mweb.co.za [196.30.179.36]) by hub.freebsd.org (Postfix) with ESMTP id 351AB37B405 for ; Mon, 4 Jun 2001 00:22:54 -0700 (PDT) (envelope-from sheldonh@starjuice.net) Received: from sheldonh (helo=axl.seasidesoftware.co.za) by axl.seasidesoftware.co.za with local-esmtp (Exim 3.22 #1) id 156ohK-0002ap-00; Mon, 04 Jun 2001 09:22:46 +0200 From: Sheldon Hearn To: Dima Dorfman Cc: audit@freebsd.org Subject: Re: cut(1) WARNS patch In-reply-to: Your message of "Fri, 01 Jun 2001 23:40:44 MST." <20010602064044.AD9263E32@bazooka.unixfreak.org> Date: Mon, 04 Jun 2001 09:22:46 +0200 Message-ID: <9970.991639366@axl.seasidesoftware.co.za> 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 Fri, 01 Jun 2001 23:40:44 MST, Dima Dorfman wrote: > 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). I've never found a graceful solution for printing integral types of varying bit width using printf. Something that _does_ work is to use a SIZE_T_FMT that's either "%d" or "%ld" conditional on the bit width of size_t. Of course, this gets clumsy unless you're prepared to use ANSI C string concatenation. Ciao, Sheldon. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message